This forum is now read-only. Please use our new forums! Go to forums
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
Press the RESET CODE
button.
Then paste the following code and Save:
var myName = "Shashank";
console.log(myName);
myName = myName.substring(0,2);
Answer 53519f707c82ca7ad000001f
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
4 comments
“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.
Refresh your browser.
gawd damn = sign
thanks “Neil” it’s work for me
Answer 5353a7387c82cafeb20011d4
// 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.
3 comments
Replace console.log(“DA”); for myName.substring(0,2); and then write console.log(myName);
still doesn’t work
Line 7 should be myName = myName.substring(0,2); and line 9 should be console.log(myName);
Answer 537d3258631fe93d190001e2
// 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).
Answer 537a4e5280ff3307e10008c8
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);
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
3 comments
This worked, thank you so much!
thanks you
Thanks