Help with "more variable practice"


#1


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


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

// 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.subscript
console.log(0, 4);


#2
This is a subscript  =>  `x[0]`, or `object['name']`
                            ^                 ^

This is a substring

myCountry.substring(0, 3)

#3

Thanks so much, ''Reading is fundamental"... lol


#4

Ok, I'm still getting the same error message after changing the word subscript to substring. when I run the code it gives me "new" but not the 1st 3 in myCountry. which was changed when we declared it a var and gave it the string value.


#5

What does your code look like, now (the last line)?


#6

I got it, thanks. had to refresh the whole thing....


#7

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