Name: Anonymous 2013-03-06 16:37
I'm just doing this on codeacademy, so i don't know if this really would work or if the shitty program is just shitty.
(the // are the instructions for the lesson)
This is what they wanted:
//On line 2, declare a variable myName and give it your name.
var myName = "Ben"
//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 = "Be"
//On line 9, use console.log to print out the myName variable.
console.log(myName)
This is what I thought would work:
//On line 2, declare a variable myName and give it your name.
var myName = "Ben";
//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.subscript (0,2);
//On line 9, use console.log to print out the myName variable.
console.log(myName);
(the // are the instructions for the lesson)
This is what they wanted:
//On line 2, declare a variable myName and give it your name.
var myName = "Ben"
//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 = "Be"
//On line 9, use console.log to print out the myName variable.
console.log(myName)
This is what I thought would work:
//On line 2, declare a variable myName and give it your name.
var myName = "Ben";
//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.subscript (0,2);
//On line 9, use console.log to print out the myName variable.
console.log(myName);