Wednesday, April 28, 2021

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. 

No comments:

Post a Comment