Problem writing a code in JavaScript


#1

// Declare a variable on line 3 called
// myCountry and give it a string value.

// Use console.log to print out the length of the variable myCountry.

// Use console.log to print out the first three letters of myCountry.

Not sure what I gotta do, please take a look at it.

Thanks


#2

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

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


#3

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