How can i fix this?


#1

// On line 2, declare a variable myName and give it your name.
(var myName = "Name" ;
// On line 4, use console.log to print out the myName variable.
console.log( var myName === "Name") );
// On line 7, change the value of myName to be just the first 2
// letters of your name.
console.log("Name".substring(0,2) );
// On line 9, use console.log to print out the myName variable.


#2

Ok. First, take out the single parentheses here:

Also, when it says to print the variable myName, all you have to do is print myName, like this:

console.log(myName);

For you have already assigned it to the string "Name", which is shown on line 2.

Also, you have to change that to

console.log(myName.substring(0,2));

It's kind of like what you did in line 4.

It'll work now, trust me. :smiley:


#3

Remove ( from this line,

(var myName = "Name" ;

and one ) from this one,

console.log( var myName === "Name") );

which should read,

console.log(myName);

These instructions need to be broken into two steps, and should use the variable:

// On line 7, change the value of myName to be just the first 2 
// letters of your name.

myName = myName.substring(0,2);

// On line 9, use console.log to print out the myName variable.

console.log(myName);

#6

Thank you! It really helped!