Getting errors in console log part(javascript) can anyone help me to get a Solution


#1

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

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.substring(0,9));

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

here is the link for the code- https://www.codecademy.com/courses/getting-started-v2/4/2?curriculum_id=506324b3a7dffd00020bf661


#2

this comment:

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

if you need the length of something, use .length, not substring


#3

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