Stuck help


#1

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

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

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

Kenya
Ken

Oops, try again. It looks like you didn't log the length of myCountry to the console.


#2

instruction:

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

so to get the length of a variable i would do like

console.log(variablename.length)


#3

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