Lessons 25


#1

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

// 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=myCountry.substring(0,3) );
What am I doing wrong?


#2

Don't declare variable values inside a Console.log statement.

console.log(myCountry=myCountry.substring(0,3) );

Should just be.

console.log(myCountry.substring(0,3) );

#3

Hi @eliederhystandrews

You have to change your last line :

console.log(myCountry.substring(0,3) );

Hold on :wink: