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.
Serializes a cookie name-value pair into a Set-Cookie header string.
JavaScript, Browser · Oct 22, 2020
When it comes to immutability, JavaScript strings are often a source of confusion. Yet they're not as complicated as you might expect.
JavaScript, String · Oct 10, 2021
Creates an array with n
elements removed from the end.
JavaScript, Array · Oct 22, 2020
Creates an array with n
elements removed from the beginning.
JavaScript, Array · Oct 22, 2020
Truncates a string up to specified length, respecting whitespace when possible.
JavaScript, String · Oct 21, 2020
Creates a function that accepts up to one argument, ignoring any additional arguments.
JavaScript, Function · Oct 22, 2020
Did you know there's a JavaScript value that's not equal to itself?
JavaScript, Type · Dec 12, 2021
Detects whether the page is being viewed on a mobile device or a desktop.
JavaScript, Browser · Oct 22, 2020
Learn how to detect undefined
object properties in JavaScript the correct way.
JavaScript, Object · Aug 7, 2022