25 I'm stuuuck


#1

Guys, I don't understand what I'm doing wrong. COuld someone give me a hint?

// Declare a variable on line 3 called
// myCountry and give it a string value.
var myCountry = "Poland";
// 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.
console.log(myCountry).substring(0,4);


#2

So at first i was going to give you a hint but ill try to explain:

  1. Your console.log(myCountry).length) need to become console.log(myCountry.length) because myCountry.length is written together.
    2.The same as number 1 your console.log(myCountry).substring(0,4); needs to become console.log(myCountry.substring(0,4) ); because myCountry.substring is written together and also the 0,4 needs to come directly after the .substring .
    Hope this helped, otherwise ill send you my full code.

#3

For all of you that want to "compare codes" :wink:

var myCountry = "Germany";
myCountry.substring(0,6)

console.log (myCountry.length);     //There you go, i deleted the comments to make id easier to read for you

console.log(myCountry.substring(0,3) );

#4

This here

below your

Isn't necessary. What were you trying to use that for?


#5

just noticed mb, before it wouldn't work without, editing my post. Ty


#6

Thanks you folks!!! :slight_smile:


#8

This topic is solved.