What am i doing wrong here? Exercise 26


#1

// On line 2, declare a variable myName and give it your name.
var myName = "Michael";
// 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.
"myName".substring(0,2);
// On line 9, use console.log to print out the myName variable.
console.log("myName")


#2

On this line:

For you to print the first 2 letters of your name use console.log()., and place the variable myName, that holds your name, inside the parenthesis then add the substring() function.

Like this:

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


#3

// On line 2, declare a variable myName and give it your name.
var myName = "Michael"
// 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")

*Thanks for the help, I applied your change and i am still getting an error. It is saying I did not "log my whole name" to the console. Not sure what this means or how to fix this...


#4

Remove the double quote on:

And add a semicolon in the end or your variable declaration on this line:


#5

Awesome! Got it, thank you so much for your help :slightly_smiling: