I am stuck on 26 in JavaScript and I don't know how to do it can you help?


#1



I am stuck on how to do the console log things from line 3 to 9 please help


Replace this line with your code.


#2

Hi you should post your code


#3

// On line 2, declare a variable myName and give it your name.
var myName = "JohnCena";
// On line 4, use console.log to print out the myName variable
console.log("John Cena

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

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


#4

here with the instruction

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

console.(myName)

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

this part you should use the method .substring() like this

var myName = "johnCena".subtring(0,2);

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

then here you should again print myName

console.log(myName);

#5
> // On line 4, use console.log to print out the myName variable
> console.log("John Cena

You didn't close the the log properly. You should've completed the quotes and the log, and add a semicolon.
console.log("John Cena");

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

You didn't touch this part. You should've used a substring.
// On line 9, use console.log to print out the myName variable.
Another part you didn't touch. You only need to print the variable for this one.

Hope that helped :slight_smile: