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

Which of the following could be the graph of the line y = -3x + 2?
Austin makes $5.50 per hour. Which expression represents his pay? Question 2 options: $5.50h $5.50 + h $5.50 - h $5.50/h
9. True or false most oils tend to dissolve best in non polar solvent 10. True or false solubility tells u how fast a solute will dissolve 11. How is the solu
Which of the following requires nutrients? A. Body processes B. Brain growth C. Feces production D. Urine Production
Which group benefitted the most from the Compromise of 1877?
What two types of muscle tissue are striated?
what is the multiplicative inverse of 3/4
What sea creature sleeps with one eye open?
Which one of the following items is subject to sales tax in the District of Columbia? A. Shampoo B. Roast beef C. Tomatoes D. Milk
The weather station model shown below indicates that winds are coming from the (1) southeast at 10 knots (2) northwest at 10 knots (3) southeast at 20 knots (4)