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, String
Escapes a string for use in HTML.
JavaScript, String
Extends a 3-digit color code to a 6-digit color code.
JavaScript, String
Replaces the last occurrence of a pattern in a string.
JavaScript, String
Unescapes escaped HTML characters.
JavaScript, String
Regular expressions are a very useful tool in a variety of situations. Save this cheatsheet for any time you need to look up their syntax and speed up your development.
JavaScript, Browser
Copies a string to the clipboard, returning a promise that resolves when the clipboard's contents have been updated.
JavaScript, String
Creates a string with uppercase characters converted to lowercase and vice versa.
JavaScript, String
Converts a string to title case.
JavaScript, String
Creates a new string with the results of calling a provided function on every character in the given string.
JavaScript, String
Converts a string to camelcase.
JavaScript, String
Converts a string to pascal case.
JavaScript, String
Converts a string to snake case.
JavaScript, String
Converts a color code to an rgb()
or rgba()
string if alpha value is provided.
JavaScript, String
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters).
JavaScript, String
Generates all permutations of a string (contains duplicates).