More variable practice



what is wrong with my code?
// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "LA";

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

"myCountry".console.log (0,9);

// Use console.log to print out the first three letters of myCountry.


There are few mistakes there.
In JavaScript console.log(); is written this way and the value you want to log out, you put it inside the ().

  1. So, for consoling out the variable myCountry length you would do:


And the same rule would follow for the substring.


If you feel like something haven't completely sit in your mind with code or how's it written, you can always go back in exercises and remind yourself :wink:


Wow thanks that helps.


So I

for my console.log's THX @dayfiri


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