Pls help me


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



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.


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