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 property is illustrated by this problem 12 + 44 = 44 = 12 Commutative property of addition Associative property of addition Additive identity
how does one describe the degree of saturation in terms of polarity and amounts of solutes and solvent
Advertising objectives can be classified based on three primary purposes. what are the three​ purposes?
How much thermal energy is in 100 grams of water at 50 degrees Celsius
Which class of anti-HIV drug targets the virus before it enters cells?
A currency’s exchange rate is
The somatic motor association area is responsible for the
Find the m/ YAX in the figure
What are the impacts of the 8th amendment?
What type of United States military base was located in Cuba?