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

All of the following are effective strategies for preventing the common cold except: a. frequent hand washing. b. avoid stress overload. c. replace toothbrus
(x÷(y÷z))÷((x÷y)÷z)also the variables are not specified.
14.40 is decreased by 20%
Double Suicide of Romeo and Juliet. A) Falling Action B) Climax C) Denouement D) Resolution A?
Blano occurs when the effect of one drug is enhanced by the presence of another drug
why are most volcanoes found around the ring of fire A. this a location where there are many hot spots. B. this is a location within an active oceanic plate. C.
estimate the quotient 57.8 ÷81
What is the basic organism that starts the aquatic food chain?
Which if the following is NOT a product of the Krebs Cycle? A) water B) carbon dioxide C) ATP or GTP D) FADH2
If a cashier gave Jasmine $10 change back when she purchased a dress for $60.00, which equation could be used to find the amount of money Jasmine gave to the c