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, Browser
Gets the protocol being used on the current page.
JavaScript, Math
Checks if the given number falls within the given range.
JavaScript, Date
Checks if a date is after another date.
JavaScript, Date
Checks if a date is before another date.
JavaScript, Date
Checks if a date is between two other dates.
JavaScript, Browser
Checks if localStorage
is enabled.
JavaScript, String
Checks if a string is lower case.
JavaScript, Browser
Checks if sessionStorage
is enabled.
JavaScript, String
Checks if a string is upper case.
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.