The JavaScript snippet collection contains a wide variety of ES6 helper functions. It includes helpers for dealing with primitives, arrays and objects, as well as algorithms, DOM manipulation functions and Node.js utilities.
JavaScript, Array
Generates all permutations of an array's elements (contains duplicates).
JavaScript, Object
Deeply removes all falsy values from an object or array.
JavaScript, Algorithm
Sorts an array of numbers, using the quicksort algorithm.
JavaScript, Algorithm
Sorts an array of numbers, using the selection sort algorithm.
JavaScript, Array
Groups the elements of an array based on the given function and returns the count of elements in each group.
JavaScript, Array
Groups the elements of an array based on the given function.
JavaScript, Array
Arrays are one of the most used data types in any programming language. Learn how to merge two arrays in JavaScript with this short guide.
JavaScript, Array
Creates an object from an array, using a function to map each value to a key.
JavaScript, Array
Filters an array of objects based on a condition while also filtering out unspecified keys.
JavaScript, Array
Removes elements from the end of an array until the passed function returns true
.
Returns the removed elements.
JavaScript, Array
Removes elements from the end of an array until the passed function returns false
.
Returns the removed elements.
Learn the basics of the destructuring assignment syntax in JavaScript ES6 and improve your code with this easy guide.
JavaScript, Array
Maps the values of an array to an object using a function.
JavaScript, Array
Performs stable sorting of an array, preserving the initial indexes of items when their values are the same.
JavaScript, Array
JavaScript ES6 introduced us to several powerful features, such as the spread and rest syntax. Learn everything you need to know in this quick guide.