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
Negates a predicate function.
JavaScript, Math
Generates a random boolean value.
JavaScript, Object
Creates a shallow clone of an object.
JavaScript, Function
Measures the time it takes for a function to execute.
JavaScript, Function
Creates a function that accepts up to one argument, ignoring any additional arguments.
JavaScript, Function
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
JavaScript, Browser
Checks if the bottom of the page is visible.
JavaScript, Type
Checks if the given argument is a native boolean element.
JavaScript, Type
Checks if the given argument is a number.
JavaScript, Math
Calculates the logarithm of the given number in the given base.
JavaScript, Math
Sums all the numbers between 1
and n
.
JavaScript, Node
Creates a directory, if it does not exist.
JavaScript, Browser
Checks if the given element is focused.
JavaScript, Browser
Checks if the browser tab of the page is focused.
JavaScript, Type
Checks if the given argument is a symbol.