Getting Stack at More Variable Practice


#1



I`m stack over at More variable Practice please help

https://www.codecademy.com/courses/getting-started-v2/4/2?curriculum_id=506324b3a7dffd00020bf661


Error Message..
Oops, try again. It looks like you didn't log the length of myCountry to the console.


Replace this line with your code. 

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCounrty = "Kenya";
myCountry.substring(0,5)
// Use console.log to print out the length of the variable myCountry.
console.log("myCountry".length);
// Use console.log to print out the first three letters of myCountry.
console.log("myCountry".subsring);


#2

Remember that when you try to call upon a variable, to never wrap it in quotes, as that will only give you the value for the name of your variable, myCountry, instead of the value you stored in the variable, Kenya. Remove the quotes around myCountry and keep that in mind


#3

Yeep I have jus figured it out..Thanks
// Declare a variable on line 3 called
// myCountry and give it a string value.
var MyCountry = "Kenya";
myCountry.string
// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.length);

// Use console.log to print out the first three letters of myCountry.
console.log(myCountry.substring(0,3) );


#4

Always remember that when declaring something, unless it is a string, to never use quotes. That'll throw you off big time


#5

Stack again at 26 PLEASE HELP
// On line 2, declare a variable myName and give it your name.
var myName = "Alianda";
// 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 = "Al";
// On line 9, use console.log to print out the myName variable.
cosnsole.log(myName.substring(0,2));


#6

Line 7 :
myName = myName.substring(0,2);

Line 9:
console.log(myName);


#7

tried that and its not working


#8

Your first mistake was in line 7. You used var on myName, a variable already defined. When it's a global variable(don't worry about what that means just that all of your variables at this stage are global) you only need to define it once, and when changing values proceed as usual, but just omit the var.
Your second mistake was line 9. There was no need to use a substring, the point of this lesson is to show you that you can change variables, and logging the value is just to show you the change. You also made a typo with console. Just fix those and you're good


#9

Stack again at 26 PLEASE HELP
// On line 2, declare a variable myName and give it your name.
var myName = "Alianda";
// 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);

This wont work for you? It's your code plus what I told you to change, and it should work.


#10

when you use a substring it doesnt work but someone else has helped me with this
// On line 2, declare a variable myName and give it your name.
var myName = "Alianda";
// 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 = "Al";
// On line 9, use console.log to print out the myName variable.
console.log(myName);


#11

That workaround also works!