Ex. 28 help


#1


EX. 26


Oops, try again. It looks like you didn't log your whole name to the console.


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


#2

To log the myName variable to the console, try putting the variable in the parentheses instead of 4.


#3

Do it like this, I've just finished this moment ago so I know:

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

I am not sure why does it work, but it does. Exercise doesn't say about console.log on line 7 but It worked for me.


#4

It gets past the code checker, but it doesn't actually work. Your myName variable has not been changed to be just the first 2 letters of your name.


#6

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