Need help


#1

Good morning coders need your help pls with exercise 25.MAYBE not getting it correctly
/ Declare a variable on line 3 called
// myCountry and give it a string value.
var mycountry = "nigeria";

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


#2

console.log("mycountry".length );

mycountry is a name of the variable not a string.so we dont need " " for it.


#3

sir,didnt work i did remove the quotes.


#4

Instruction:

Declare a variable on line 3 called myCountry

so c should be uppercase in mycountry.


#5

yeah
thanks it worked wow! didn't see that.


#6

CODE LIKE THIS:

var myCountry ="Nigeria";
console.log(myCountry.length);
console.log(myCountry.substring(0,3));


#7

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