[JS] Data Types I & II: Numbers & Strings


#1

I'm doing this course because I want to improve my knowledge but I'm stuck at level 10. Below my code:


var s = "world is mine".length;
console.log(s);

Oops, try again. Make sure you find the length of your string.


#2

console.log(s <---------- );

All you have wrong is the location of .length. you want to put it where I have the arrow. the difference is that you are creating the variable in the first line so it is only looking for the value of "s". you want to call it and then check how long it is.


#3

Thanks for your reply but I also tried this:

var s = "world is mine";
console.log(s.length);

But same issue.. :frowning:


#4

Try using "world is mine".length only (without defining it as a variable and calling console.log).


#5

That's was it :slight_smile: Thanks, man.


#6

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