What am i doing wrong it says i need to add a semicolon but i did

Tell us what’s happening:
Describe your issue in detail here.

Your code so far


var myname="ethan";
var myname="12 cats";



Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 13904.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36

Challenge: Declare JavaScript Variables

Link to the challenge:

The tests say:
You should declare myName
Not assign it. (You’ve also assigned a variable twice which will cause an error.)
Also note the capitalization of the variable name with the hint they give you:

var ourName;

When you declare a variable, all you are doing is telling javaScript you need a variable and you’re giving it a name. → var myName;
Notice, it has not been given a value. When you assign a variable a value, then you use the (=) equal sign → var myName = 'ethan';

Note: you cannot decalare a variable of the same name twice.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.