Tell us what’s happening:
Your code so far
var b = 2;
// Only change code below this line
var = 7;
Your browser information:
Your Browser User Agent is:
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0.
Link to the challenge:
The challenge instructions are:
Assign the value 7 to variable a.
Assign the contents of a to variable b.
When you declare a variable, you use the following syntax:
When you want to declare a variable and assign it an initial value (initializing a variable), you use the the following syntax:
var variableBeingInitialized = value;
When a variable has already been declared (var in front) and you want to assign a value to the variable, you use the following syntax:
variableBeingAssignedAValue = value;
You have var = 7; which results in a error, because you used var without specifying a variable name before the = operator.
Now, try to assign the number 7 to variable a. Hint: Variable a has already been declared (var a;)
Then, assign variable a to variable b. Hint: Variable already has a value of 2, so b is just a value of 2.
font-family: Lobster, Monospace;
Click here for cat photos.
Things cats love:
- cat nip
- laser pointers
Top 3 things cats hate:
- flea treatment
- other cats