Search posts, tags, users, and pages
Arrays are essential data structures used in JavaScript. It lets you store sequences of values. With array methods, you can transform and manipulate values
Ridwan Abiola
@thisbeardedone
Front Developer
Markdown supported · ⌘↵ to post
Shubh Sharma
Good one 🔥
Anthony Fung
Good solution!
You can do the same by relying on the truthiness of a value too, e.g. myArray.filter(n => n);. Something to be careful of is that 0 is considered a falsy value.
myArray.filter(n => n);
0
Shubh Sharma
Good one 🔥