25. More Variable Practice


#1

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


It claims that I haven't declare a variable called MyCountry but I did at the top does anyone have solution?


// Declare a variable on line 3 called
// myCountry and give it a string value.
var MyCountry = "hijosh";


// 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));

strong text


#2

@cooljosh1

Problem1.
You misspelled.
MyCountry or myCountry ?

Problem2.
here..
console.log("MyCountry".substring(0,3));

Variables aren't put inside the quotes!


#3

Oh, thanks I did that but i still get an error what do you think has gone wrong? it still claims I haven't declare a variable called MyCountry


#4

Oh myCountry ty i've literally been scratching my head for minutes thinking what i've done wrong


#5

well i'm at school got to go


#6

hello its very hard i do not get it


#7

Please copy and paste your code and tell us exactly what you do not get.


#8

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "macedonia";

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.lenght);

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


#9

console.log(myCountry.lenght);

length or lenght?


#10

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.