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
Learn how to use the JavaScript ES6 spread syntax to converting iterables to arrays and level up your code today.
JavaScript, Date
Returns the human-readable format of the given number of milliseconds.
JavaScript, Browser
Creates an object containing the parameters of the current URL.
JavaScript, Array
Converts an array of objects to a comma-separated values (CSV) string that contains only the columns
specified.
JavaScript, String
Converts a comma-separated values (CSV) string to a 2D array of objects. The first row of the string is used as the title row.
JavaScript, String
Finds all the indexes of a substring in a given string.
JavaScript, String
Converts an hsl()
color string to an object with the values of each color.
JavaScript, String
Converts an rgb()
color string to an object with the values of each color.
JavaScript, String
Changes the lightness value of an hsl()
color string.
JavaScript, Browser
Parses an HTTP Cookie header string, returning an object of all cookie name-value pairs.
JavaScript, Algorithm
Encrypts or decrypts a given string using the Caesar cipher.
JavaScript, Browser
Encodes a set of form elements as a query string.
JavaScript, Browser
Copies a string to the clipboard.
Only works as a result of user action (i.e. inside a click
event listener).
JavaScript, Date
Returns the ISO format of the given number of seconds.
JavaScript, String
Counts the occurrences of a substring in a given string.