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.
Removes elements from the end of an array until the passed function returns true
. Returns the removed elements.
JavaScript, Array · Nov 29, 2020
Removes elements from the end of an array until the passed function returns false
. Returns the removed elements.
JavaScript, Array · Nov 29, 2020
Converts the given array elements into <li>
tags and appends them to the list of the given id.
JavaScript, Browser · Oct 20, 2020
Groups the elements of an array based on the given function and returns the count of elements in each group.
JavaScript, Array · Nov 3, 2020
Groups the elements of an array based on the given function.
JavaScript, Array · Oct 22, 2020
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 · Jun 12, 2021
Creates an object from an array, using a function to map each value to a key.
JavaScript, Array · Jun 20, 2021
Learn the basics of the destructuring assignment syntax in JavaScript ES6 and improve your code with this easy guide.
JavaScript, Array · Jun 12, 2021
A few tips and tricks to help you filter arrays in JavaScript more efficiently.
JavaScript, Array · Sep 28, 2022
Converts an array of strings into an object mapping to true.
JavaScript, Array · Apr 12, 2022
Creates an object from an array, using the specified key and excluding it from each value.
JavaScript, Array · Jun 27, 2021
Maps the values of an array to an object using a function.
JavaScript, Array · Oct 21, 2020
Returns the most frequent element in an array.
JavaScript, Array · Sep 15, 2020
Maps an object array to an object, using the provided mapping functions.
JavaScript, Array · Feb 4, 2023
Replaces an item in an array or appends it, if it doesn't exist.
JavaScript, Array · Feb 19, 2023