This forum is now read-only. Please use our new forums! Go to forums
banner
Close banner
what am i doing wrong? lesson 26 in javascript
// On line 2, declare a variable myName and give it your name. //var myname=”nir” // 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(nir.substring(0,2)); // On line 9, use console.log to print out the myName variable. //console.log(myname);
Answer 535123cd52f8635239001959
0 votes
Try this one bellow and compare it with yours :).
var myName = (“Nir”);
console.log(myName);
var myName = (“Nir”.substring(0,2));
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
it keeps saying i did not declare a variable…odd
only when i actually copied it worked!!!! many tnx
ok. Those are your errors that you made Line 2 : “nir”… it needs to be in ( ) and on the end ; semicolon and you can use /// var myName just for looks i think with N.