Thursday, April 29, 2021

Javascript Practice 04: JS Hero - Reassignment


Question: 

Which value does x have after execution of the following code?

let x = 'Tic';

x = 'Tac';

x = 'Toe';




Answer: 

'Toe'

Declared a variable using let.
You can reassign a new value to a variable using the = operator as shown above. 

No comments:

Post a Comment