This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by Shashank K
about 10 years

26.28. 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=”Shashank”; // 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=”Shashank”.substring(0,2); // On line 9, use console.log to print out the myName variable. console.log=(myName);

It keeps telling my that I didn’t log in my whole name. What am I doing wrong?

Answer 5351c6e79c4e9d6aaf0005ad

0 votes
Best answer

Permalink

Press the RESET CODE button. Then paste the following code and Save:

var myName = "Shashank";
console.log(myName);
myName = myName.substring(0,2);
points
Submitted by tony de araujo
about 10 years

3 comments

Shashank K almost 10 years

This worked, thank you so much!

warren almost 10 years

thanks you

ErrorFixed over 9 years

Thanks

Answer 53519f707c82ca7ad000001f

1 vote

Permalink

console.log=(myName); <– remove the = sign


Replace this: var myName=”Shashank”`.substring(0,2);

With this: myName = myName.substring(0,2);


console.log=(myName); <– remove the = sign

points
Submitted by tony de araujo
about 10 years

4 comments

Shashank K about 10 years

“TypeError: console.log is not a function” I messed around with the code and found out that if I don’t put the “=” sign after console.log, I’ll get that message. Replacing did not work either, gives me the not your whole name message :( Can’t really figure out what’s wrong.

Neil almost 10 years

Refresh your browser.

mihamartinez almost 10 years

gawd damn = sign

יוסי פריד over 8 years

thanks “Neil” it’s work for me

Answer 5353a7387c82cafeb20011d4

0 votes

Permalink

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

points
Submitted by DANISHKALIM
almost 10 years

3 comments

tony de araujo almost 10 years

Replace console.log(“DA”); for myName.substring(0,2); and then write console.log(myName);

flores610msn.com almost 10 years

still doesn’t work

Neil almost 10 years

Line 7 should be myName = myName.substring(0,2); and line 9 should be console.log(myName);

Answer 537d3258631fe93d190001e2

0 votes

Permalink

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

I was making mistake again and again but couldn’t get it until i wrote:

console.log(myName); —-in line 9.

I was using quotes in line 9 as:

console.log(“myName”);

Then I realized that using quotes means myName is a word while using myName without quotes means myName = Sh (read line 7).

points
Submitted by Shaheen Iqbal Malik
almost 10 years

Answer 537a4e5280ff3307e10008c8

-1 votes

Permalink

this works the key is to watch what appears in the editor/lintor every time you hit console .log you dont have to type the whole exercise before submitting. // On line 2, declare a variable myName and give it your name. var myName = “leon”; // 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 =”le”; // On line 9, use console.log to print out the myName variable. console.log(myName);

points
Submitted by biglee9433
almost 10 years