Arrays are one of the most common data types in JavaScript. While there are many libraries that deal with them, here are some awesome tips and tricks you can leverage in your code without adding any external dependencies.
JavaScript, Array
Finds all unique values in an array.
JavaScript, Array
Removes falsy values from an array.
JavaScript, Array
Checks if the provided predicate function returns true
for at least one element in a collection.
JavaScript, Array
Checks if the provided predicate function returns true
for all elements in a collection.
JavaScript, Array
Checks if the provided predicate function returns false
for all elements in a collection.
JavaScript, Array
Calculates the difference between two arrays, without filtering duplicate values.
JavaScript, Array
Returns every element that exists in any of the two arrays at least once.
JavaScript, Array
Returns the elements that exist in both arrays, filtering duplicate values.
JavaScript, Array
Returns the head of an array.
JavaScript, Array
Returns all elements in an array except for the first one.
JavaScript, Array
Returns the last element in an array.
JavaScript, Array
Flattens an array up to the specified depth.