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. 

Comments

Popular posts from this blog

Junior Developer Central JS Practice Exercise - 22

Junior Developer Central JS Practice Exercise - 21

Javascript Practice 68: JS Hero - do...while loop