Javascript


#1


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

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

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

last line. when i submit it, it says i didn't log the first 3 letters of myCountry var.. What did i do wrong


#2

to print out the length of the variable myCountry :

console.log(myCountry.length);

#3

ah right thanks. the line on 6 was wrong.. horrible reader i am :cry:


#5

my problem the line after that..is it console.log(myCountry.substring(0,4)) ...for some reason it tells me u have to insert the first 3 letters...any idea


#6

How many letters do you see being printed with the code that you have used?


#7

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