More Variable Practise


#1

Yo, so i have literally no idea what to do on this one... plez help me. <3

https://www.codecademy.com/courses/getting-started-v2/4/2?curriculum_id=506324b3a7dffd00020bf661#

I have no error msgs.

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

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

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

https://gyazo.com/e718b0af50a08cc2a408452f60ae1204


#2

// Use console.log to print out the length of the variable myCountry.
console.log(myCountry.substring(0,6)) //Print out length (which is a number and not a string)
//General syntax for length is myObject.length

#3

it did not work. hmmmmm


#4

@datfatcat wanted to say
Instruction:

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

so i would do like

console.log(myCountry.length);

try this after refresh your browser. if your code still doesn't work then post your update code here :slight_smile:


#5

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