Working with variables
importance: 2
- Declare two variables:
admin
andname
. - Assign the value
"John"
toname
. - Copy the value from
name
toadmin
. - Show the value of
admin
usingalert
(must output “John”).
In the code below, each line corresponds to the item in the task list.
let admin, name; // can declare two variables at once
name = "John";
admin = name;
alert( admin ); // "John"