Pls help me


#1


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


It looks like myCountry isn't a string


'
// Declare a variable on line 3 called
// myCountry and give it a string value.
var str="myCountry";
var myCountry=9;
// Use console.log to print out the length of the variable myCountry.
console.log(str.length );

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

`


#2

Declaring a variable is done with var. Above you have the wrong name, and an incorrect string value.

var myCountry = "Canada"

It would be helpful to read the lesson text leading up to this lesson. The exercise does not introduce anything that has not been covered in the lessons.


#4

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