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.
filter(Boolean), wow. Thank you.
learned how to remove empty strings from array using filter(). thanks!
Learned a new shorthand for .filter(val => Boolean(val)). Thanks!
For more info you can read the documentation for the filter function:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
this might help: arr.filter(Boolean) is the same as: arr.filter( x => Boolean(x) )
This is an awesome use case for Boolean! Awesome work!
How does the use of Boolean only filter empty strings that evaluate as false and not strings that evaluate as true?
Use spoiler flag, please.
This comment is hidden because it contains spoiler information about the solution
I have seen such usage of Boolean for the first tme
I learned a ton from looking at this one. Thanks! Filtering out empty strings, because they evaluate as false, was very clever.
Very clever, I've never seen Boolean used this way but it makes sense to me!
The use of the filter is very clever. Nice solution!
This comment is hidden because it contains spoiler information about the solution
this is clever but I think the filter(Boolean) is a bit hard to understand, or maybe it's because it's the first time I've seen it used like this... Cool nonetheless