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

Javascript Practice 70: JS Hero - break and continue

Javascript Practice 48: JS Hero - if...else