Javascript Practice 03: JS Hero - Several variables


Question: 

Declare a variable flower and assign it the value 'rose'
Declare a second variable tree and assign it the value 'maple'.




Answer: 

You can create variables using var, let and const. 

var flower = 'rose'; or
let flower = 'rose'; or
const flower = 'rose'; 

var tree = 'maple'; or
let tree = 'maple'; or
const tree = 'maple'; 

All of the options will work and are OK to use. 

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