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.
Checks if sessionStorage
is enabled.
JavaScript, Browser · Dec 31, 2020
Checks if the given argument is a string. Only works for string primitives.
JavaScript, Type · Oct 20, 2020
Rounds a number to a specified amount of digits.
JavaScript, Math · Oct 22, 2020
Measures the time it takes for a function to execute.
JavaScript, Function · Oct 22, 2020
Returns every element that exists in any of the two arrays at least once.
JavaScript, Array · Oct 22, 2020
Returns a function that takes one argument and runs a callback if it's truthy or returns it if falsy.
JavaScript, Function · Oct 22, 2020
Checks if the bottom of the page is visible.
JavaScript, Browser · Oct 22, 2020
Clamps num
within the inclusive range specified by the boundary values a
and b
.
JavaScript, Math · Oct 22, 2020
Returns the absolute value of the first number, but the sign of the second.
JavaScript, Math · Oct 7, 2020
Checks if the given number falls within the given range.
JavaScript, Math · Nov 1, 2020