Into to JavaScript, Lesson 21: Is it wrong?


#1

The lesson notes say this;
10 % 2 === 0 evaluates to true
7 % 3 === 0 evaluates to false because there is 1 left over.

In actual coding, it's the inverse. the 1 leftover rings out as true, and 0 evaluates to false.


#2

Hi!
At the same lesson,21,I write the answer like that

"wonderfulday".substring(4,7);

But it answers that "Did you remember to take your .substring() from the string 'wonderful day'? Make sure to type your string exactly as shown!"

Sorry,I can't find my mistake!!


#3

It should be

"wonderfulday".substring(3,7);


#4

"wonderful day".substring(3,7);


#5

I think you may be disregarding the === 0 part of those expressions.


#6

Excellent point. Thanks for clarifying!