Ive been stuck on this for a while and am getting frustrated


#1

Ive been stuck on this for a while and am getting frustrated, can anyone tell me what is wrong with my code for the task required?

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

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


8. I'm stuck and there is not much for instructions
#2

Hello,
You only use quotation marks when you're going to write a string and not the variable itself.
instead of using var "myCountry"=7 you must use var myCountry = 7. The same is true in your console.log like console.log(myCountry.length)

You'll use the quotation marks in var myCountry = "Brazil"

Hope it helps


#3

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