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, Object
Checks if two URLs are on the same origin.
JavaScript, Type
Checks if the given argument is a string. Only works for string primitives.
JavaScript, String
Pads a given number to the specified length.
JavaScript, Math
Rounds a number to a specified amount of digits.
JavaScript, Array
Returns every element that exists in any of the two arrays at least once.
JavaScript, Math
Checks if the given value is a number.
JavaScript, Function
Creates a function that accepts up to two arguments, ignoring any additional arguments.
JavaScript, Math
Clamps num
within the inclusive range specified by the boundary values a
and b
.
JavaScript, Type
Clones a regular expression.
JavaScript, Function
Returns a function that is the logical complement of the given function, fn
.
JavaScript, Math
Returns the absolute value of the first number, but the sign of the second.
JavaScript, Function
Checks if at least one function returns true
for a given set of arguments.
JavaScript, Browser
Checks if the parent
element contains the child
element.
JavaScript, Browser
Checks if the element specified is visible in the viewport.
JavaScript, Browser
Opens or closes an element in fullscreen mode.