Help with "more variable practice"


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.

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

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

This is a substring

myCountry.substring(0, 3)


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


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.


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


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


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