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
Converts a RGB color tuple to HSL format.
JavaScript, Browser
Serializes a cookie name-value pair into a Set-Cookie header string.
JavaScript, Array
Returns all elements in an array except for the first one.
JavaScript, String
Truncates a string up to specified length, respecting whitespace when possible.
JavaScript, Type
Did you know there's a JavaScript value that's not equal to itself?
JavaScript, Math
Ever needed to convert a decimal number to hexadecimal? Here's a quick and easy way to do it.
JavaScript, Browser
Creates an element from a string (without appending it to the document). If the given string contains multiple elements, only the first one will be returned.
JavaScript, String
Formats a number using the local number format order.
JavaScript, String
Converts a string from camelcase.
JavaScript, Browser
Gets the currently selected text.
JavaScript, String
Indents each line in the provided string.
JavaScript, Browser
Inserts an HTML string after the end of the specified element.
JavaScript, Browser
Inserts an HTML string before the start of the specified element.
JavaScript, Type
Checks if the passed value is an object or not.
JavaScript, Type
Checks if the provided value is an object created by the Object constructor.