bjmj3964 bjmj3964
  • 14-07-2019
  • Computers and Technology
contestada

What is variable hoisting in JavaScript? Provide examples.

Respuesta :

Limosa
Limosa Limosa
  • 21-07-2019

Answer:

before executing a code using javascript hoisting we can move any variable declaration to the top of the scope in a code.

Explanation:

It is to be remembered that hoisting works with declaration not with initialization.

example:

//initializing a variable s

var s = 2;

t = 4

elem.innerHTML = s + " " + t;           // Display s and t values

// initializing a variable for hoisting

var t;

Answer Link

Otras preguntas

Use the subjects and verbs provided and include the vocabulary word for the images in your complete French sentences. Example: Je/regarder Response: Je regarde
how can the use of new technology in industry benefit workers
Plato's student was _____. Aristotle Alexander Philip Ptolemy
Subtract 4 from 1/6 of 42
why did Dante most likely choose to write his views on Christianity in an indirect manner when he wrote the Divine Comedy?
An adult with a BMI of 25 to 30 is considered
Discuss, at least six ( 6 ) possible advices that could be given in a communication related conflict.
Read the Mungo Lady and Mungo Man While Dr. Thorne is not the author of the reading, what are his qualifications? What experience does he have?
Which of the following is the biggest obstacle to traveling by boat on the Congo River
ways in which the sugar daddy/mamma phenomenon could lead to HIV infection