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

find an equivalent expression without parentheses -(50x-15y+15)=
how is mass transit in cities a possible solution tk urban air pollution?
Find Domain of the functionsquare root of (x-8)/x(x-9)
How were life forms affected by the rise in atmospheric oxygen levels that began 2.2 billion years ago?
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
Can someone use the word delta in a sentence
find an equivalent expression without parentheses -(50x-15y+15)=
How is it possible for Mercury to have frozen ice ?
Data are drawn from a symmetric and bell shaped distribution with a mean of 120 and a standard deviation of 5. There are 900 observations in the data set. What
How were life forms affected by the rise in atmospheric oxygen levels that began 2.2 billion years ago?