Calculate SHA-256 hash in JavaScript
Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js.
The JavaScript snippet collection contains a wide variety of ES6 helper functions. Browser snippets include helper functions for selecting, traversing, and manipulating DOM elements, while general-purpose helpers can be found in the JavaScript snippet collection.
Calculate a SHA-256 hash in JavaScript using native APIs in both the browser and Node.js.
Learn how to traverse the DOM and find all elements related to a given element.
The Event Loop is a source of confusion for many developers, but it's a fundamental piece of the JavaScript engine.
Ever wondered how React's rendering works? Here's a simple JavaScript function that renders a DOM tree in a specified container.
Learn how to programmatically copy text to clipboard with a few lines of JavaScript and level up your web development skills.
Learn the differences between JavaScript ES6 arrow functions and regular functions and how they affect event listener callbacks.
Convert the data from an HTML form into a JavaScript object or serialize it into a query string.
Master URL handling by learning how to get the base URL and the URL parameters as an object in JavaScript.
Learn how to perform HTTP GET, POST, PUT, and DELETE requests in JavaScript.
Generate a UUID in JavaScript using native APIs in both the browser and Node.js.
While these two properties are very similar, there are some key differences that you should be aware of.
Learn how to parse or serialize a cookie with JavaScript, quickly and effectively.
Use simple DOM queries to find all the images contained within an element.
Level up your JavaScript logging with these console.log()
tips and tricks.
Ever wanted to show or hide one or more elements in HTML, using JavaScript? Turns out it's very easy to do so.
Ever had elements that horizontally overflow the viewport? This JavaScript function can help you identify them.
Learn how to add or remove event listeners from elements with ease.
Ever wanted to listen for multiple events on an element and handle them with the same function? Here's how!
Not sure if you need to prefix a CSS property in order to use it? Here's a simple way to figure it out!
Ever needed to convert a NodeList
to an array in JavaScript? Here's the fastest way to do so.
Learn all of the options JavaScript provides for modifying the URL of the current page in the browser without reloading the page.
Understand how events work in JavaScript and learn when to use event bubbling, event capturing and event delegation with this short guide.
Level up your event handling skills by learning how to attach or detach event listeners from multiple elements at once.
Ever wanted to get the value of an HTML input element as a number? Learn an easy way to do it with this handy trick.