26. It looks like you didn't log your whole name to the console


#1

// On line 2, declare a variable myName and give it your name.
var myName = 'Miguel';
// 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.substring(0,2);

But yet the ■■■■ message appears...
Oops, try again. It looks like you didn't log your whole name to the console.

Any help??


26. I did this and I got green Way to go, but It looks it is not printing new var defined
#2

Look at this line:

var myName = 'Miguel';

It makes sense that you would want to assign a new value to a variable. So that's good.

Now, look at this line:

console.log = (myName);

It doesn't make sense that you would want to assign a new value, in other words, replace, all of the code that makes console.log work. After you fix that line, to put console.log back the way it was, you are going to reload/refresh your web page.


#3

Thanks, I was truly blinded...
I wasn't quite getting where am I was missing the point...
Truly helpful! Many thanks again.


#4

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