This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Emily
over 9 years

25/28 I'm confused but I really want to understand this

// Declare a variable on line 3 called // myCountry and give it a string value. var myCountry = “USA”

// 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.substrings(0,3));

What am I doing wrong?

Answer 544d2e5352f863a8b400052f

0 votes

Permalink

I did it like this and got answer var myCountry=”Kilkirk”

// 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,3));

points
Submitted by truecodersur
over 9 years

6 comments

truecodersur over 9 years

maybe the ; is the difference.

17mcnamarak over 9 years

also you said substings instead of substring, singular

mr_runner_2626 over 9 years

/\ /\ /\

mr_runner_2626 over 9 years

instead of my country in the last line put USA

Neil over 9 years

@mr_runner_2626 Absolutely not correct!!!!

Emily over 9 years

then what is @neil

Answer 544f755252f863425500190f

0 votes

Permalink

I got it! // Declare a variable on line 3 called // myCountry and give it a string value. var myCountry =”USA”;

// 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,3));

bottom line i was saying USA when it says print out the first three letters of myCountry…..i was dumb haha. Also I forgot the ; after the first two lines

points
Submitted by Emily
over 9 years

1 comments

Neil over 9 years

Glad you got there in the end.