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.
Generates an array with the given amount of items, using the given function.
JavaScript, Array · Oct 22, 2020
Initializes a 2D array of given width and height and value.
JavaScript, Array · Oct 20, 2020
Returns the elements that exist in both arrays, filtering duplicate values.
JavaScript, Array · Oct 20, 2020
Finds the lowest index at which a value should be inserted into an array in order to maintain its sorting order.
JavaScript, Array · Oct 22, 2020
Filters out the elements of an array that have one of the specified values.
JavaScript, Array · Oct 22, 2020
Finds the highest index at which a value should be inserted into an array in order to maintain its sort order.
JavaScript, Array · Oct 22, 2020
Changes a function that accepts an array into a variadic function.
JavaScript, Function · Jun 13, 2021
Checks if there are duplicate values in a flat array.
JavaScript, Array · Oct 22, 2020
Determines if two arrays have a common item.
JavaScript, Array · Feb 17, 2023