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, Math
Generates a random boolean value.
JavaScript, Object
Creates a shallow clone of an object.
JavaScript, Function
Creates a function that accepts up to one argument, ignoring any additional arguments.
JavaScript, Browser
Checks if the bottom of the page is visible.
JavaScript, Node
Creates a directory, if it does not exist.
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, Node
Loads a module after removing it from the cache (if exists).
JavaScript, Math
Sums all the numbers between 1
and n
.
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.
JavaScript, Math
Checks if two numbers are approximately equal to each other.
JavaScript, Math
Converts an angle from degrees to radians.