26.Change variables values


#1

What I do wrong?
It say:
"Oops, try again. It looks like you didn't log your whole name to the console."

I write:

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

Pls help me!


#2

Remove the = sign between console.log and (myName),

and here,


#3

Now it say:"Oops, try again. Your code doesn't look quite right. Check the Hint if you need help!"
and in console say: "TypeError: console.log is not a function"

Now, my code is:

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


#4

LOL Now work, thanks :slight_smile:
I just had to give it a refresh


#5

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