Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
this is simple solution!!!
This comment is hidden because it contains spoiler information about the solution
Yes, in your case an empty array is acctually seen true in js.
The Boolean callback fn passed in the filter method only FILTERS those who are falsy, and if you are not sure which vals in js are falsy, this link may help:"https://developer.mozilla.org/en-US/docs/Glossary/Falsy".
Again, the result is 3 in your case and it's acctually prove this solution is right, cause only falsy vals are filtered.
Hope my belated comment helps!
Yes, it works this way, and your answer would be 7. But it's not what the kata asks.
Wouldn't it be 7? -7 * -1 = 7. Or it doesn't work this way?
What if the input was
-7
?Hi. Could someone please explain to me why isn't it possible just to write an expression
return num * -1 ?
It doesn't work in JavaScript this way?
works.
.
Is that so?
Always the one liners! Great solution
This solution may not be the most intuitive for beginners, but it is the best you can do.
that's not readable code
nice one ;)
nice!
Loading more items...