back to the lesson

Working with variables

importance: 2
  1. Declare two variables: admin and name.
  2. Assign the value "John" to name.
  3. Copy the value from name to admin.
  4. Show the value of admin using alert (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"