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, Function
Curries a function.
JavaScript, Function
Iterates over a callback n
times.
JavaScript, Function
Customizes a coalesce function that returns the first argument which is true
based on the given validator.
JavaScript, Function
Changes a function that accepts an array into a variadic function.
JavaScript, Function
You've probably come across the double negation operator (!!
) before, but do you know what it does?
JavaScript, Function
Calls the argument if it's a function, otherwise returns it.
JavaScript, Function
Creates a function that will invoke a predicate function for the specified property on a given object.
JavaScript, Function
Creates a debounced function that delays invoking the provided function until at least ms
milliseconds have elapsed since its last invocation.
JavaScript, Function
Creates a generator, that keeps producing new values until the given condition is met.
JavaScript, Function
Creates a generator, that keeps producing new values as long as the given condition is met.
JavaScript, Function
An Immediately Invoked Function Expression (IIFE) is a JavaScript trick that trips up many developers. Here's what you need to know.
JavaScript, Function
Attempts to invoke a function with the provided arguments, returning either the result or the caught error object.
JavaScript, Function
Given a key and a set of arguments, call them when given a context.
JavaScript, Function
Logs the name of a function.
JavaScript, Type
Checks if the given argument is a function.