Please help on 26


#1

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

Can anyone tell me what is wrong?This is the message that i recive.Oops, try again. There was a problem with your syntax.


#3

I think the error is the semicolon after (0,2);


#4

yes the code should just be console.log(myName.substring(0,2);


#5

that did not work for me. Please do the right answer next time okay.


#6

Oh, I forgot the parentheses after the (0, 2). That was just a typo. Sorry. the correct code is as follows:

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

Sorry for the error!


#7

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