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

0 points
almost 9 years

26/28 What i am doing wrong?

// On line 2, declare a variable myName and give it your name. myName=”Parry” script.js 1 2 // On line 2, declare a variable myName and give it your name. myName=”Parry” // 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.sustring( 0,2) // On line 9, use console.log to print out the myName variable. console.log(myName.substring(0,2)); // 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.sustring( 0,2) // On line 9, use console.log to print out the myName variable. console.log(myName.substring(0,2)); pls help, thnks in advance.

Answer 553e8ed59113cbf1ac00031b

0 votes

Permalink

Here is what i did // On line 2, declare a variable myName and give it your name. var myName =”August”; // On line 4, use console.log to print out the myName variable. console.log(“August”); // On line 7, change the value of myName to be just the first 2 // letters of your name. console.log(myName.substring(0,2) ) // On line 9, use console.log to print out the myName variable.

console.log(myName.substring(0,2) )

points
almost 9 years

4 comments

Janet Yu almost 9 years

Did it work?

Yea for me it worked :)

Ki Ki almost 9 years

// On line 2, declare a variable myName and give it your name. myName=”Cristina”; // On line 4, use console.log to print out the myName variable. console.log(“Cristina”); // On line 7, change the value of myName to be just the first 2 // letters of your name. myName.substring(0,2); // On line 9, use console.log to print out the myName variable. console.log(myName.substring(0,2) ); doesn t works

console.log(myName.substring(0,2) ); remove the ; at the end

Answer 5541bf03d3292fab2c000045

0 votes

Permalink

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

points
Submitted by Shihab BinAli
almost 9 years

2 comments

var myName = “yourname” console.log(“yourname”) console.log(myName.substring(0,2) ) console.log(myName.substring(0,2) )

This one should work :)

Answer 554a711c9113cb7e2700046b

0 votes

Permalink

On line 7 you wrote sustring instead of substring :)

points
Submitted by Giuliaaaa
almost 9 years