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
Calculates the ranking of an array based on a comparator function.
JavaScript, Math
Calculates the sum of an array, after mapping each element to a value using the provided function.
JavaScript, Math
Creates an array of partial sums.
JavaScript, Math
Reverses a number.
JavaScript, Math
Initializes an array containing the numbers in the specified geometric progression range.
JavaScript, Math
Converts an integer to its roman numeral representation.
Accepts value between 1
and 3999
(both inclusive).
JavaScript, Math
Returns the maximum value of an array, after mapping each element to a value using the provided function.
JavaScript, Array
Returns the n
maximum elements from the provided array.
JavaScript, Math
Returns the minimum value of an array, after mapping each element to a value using the provided function.
JavaScript, Array
Returns the n
minimum elements from the provided array.
JavaScript, String
Converts a number in bytes to a human-readable string.
JavaScript, Array
Finds the lowest index at which a value should be inserted into an array in order to maintain its sorting order, based on the provided iterator function.
JavaScript, Math
When formatting decimal values in JavaScript, trailing zeros can be undesired. Here's how to deal with them.
JavaScript, Array
Creates a new array out of the two supplied by creating each possible pair from the arrays.
JavaScript, Math
Generates an array, containing the Fibonacci sequence, up until the nth term.