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.
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
Inverts the key-value pairs of an object, without mutating it.
JavaScript, Object · Oct 20, 2020
Maps the keys of an object using the provided function, generating a new object.
JavaScript, Object · Oct 21, 2020
Maps the values of an array to an object using a function.
JavaScript, Array · Oct 21, 2020
Maps the values of an object using the provided function, generating a new object with the same keys.
JavaScript, Object · Oct 21, 2020
Maps an object array to an object, using the provided mapping functions.
JavaScript, Array · Feb 4, 2023
Pretty-printing JSON objects in pretty easy and customizable in JavaScript. Here's the gist of it.
JavaScript, Object · Jul 30, 2022
JavaScript's strict mode can make your code faster, cleaner and more secure.
JavaScript, Function · Nov 28, 2021
Gets the target value in a nested JSON object, based on the given key.
JavaScript, Object · Oct 19, 2020
Gets the target value in a nested JSON object, based on the keys
array.
JavaScript, Object · Oct 19, 2020
Creates an object with the unique values of an array as keys and their frequencies as the values.
JavaScript, Array · Oct 19, 2020
Nests recursively objects linked to one another in a flat array.
JavaScript, Object · Oct 21, 2020
Sorts an array of objects, ordered by properties and orders.
JavaScript, Object · Oct 21, 2020