Working with Typed Arrays in Modern JavaScript
Updated: May 16, 2023
What are Typed Arrays? Typed Arrays are a way to handle binary data in JavaScript. They are array-like objects that provide a mechanism for reading and writing raw binary data in memory buffers. Unlike normal arrays, Typed Arrays......
JavaScript: 4 Ways to Convert a Map into an Object
Updated: May 15, 2023
This practical, example-based article will walk you through a couple of different ways to turn a Map into an object in modern JavaScript (ES6 and newer). I assume you already have some knowledge about the programming language, so I......
JavaScript: Add/Remove Key-Value Pairs to/from a Map
Updated: May 15, 2023
This succinct and straightforward article will show you how to add/remove key-value pairs to/from a Map in modern JavaScript. Without any further ado, let’s get to the point. Adding key-value pairs to a Map You can add a......
JavaScript: Convert a Map object to JSON and vice versa
Updated: May 15, 2023
Converting a Map to a JSON string In modern JavaScript (ES6 and beyond), the most elegant and efficient way to convert a Map to JSON is to use the Object.fromEntries() method to convert the Map to an object and then use the......
JavaScript: 4 Ways to Convert an Object to a Map
Updated: May 15, 2023
This practical, example-based article will walk you through a couple of different ways to convert an object into a map in modern JavaScript (ES6 and beyond). I assume you already have some knowledge about the programming language, so I......
Working with WeakSet in Modern JavaScript
Updated: May 15, 2023
What is a WeakSet In modern JavaScript (ES6 and beyond), a WeakSet is a collection of garbage-collectible values, including objects and non-registered symbols. Garbage-collectible values are values that can be deleted by the......
Working with WeakMap in Modern JavaScript
Updated: May 14, 2023
Overview What is a WeakMap? A WeakMap is a collection of key/value pairs whose keys must be objects, with values of any arbitrary JavaScript type, and which does not create strong references to its keys. That means an object’s......
Working with Sets in Modern JavaScript
Updated: May 13, 2023
What are Sets? Sets are a type of object in JavaScript that let you store unique values of any type, whether primitive values or object references. You can think of them as a collection of items that have no duplicates. For example,......
Let, Const, and Var in Modern JavaScript
Updated: Apr 27, 2023
let, const, and var are all keywords for declaring variables in JavaScript, but they have different scoping, hoisting, and reassignment behaviors. In general, with ES6 and beyond, it is recommended to use let or const instead of var......
JavaScript: Convert an Object to a Query String and Vice Versa
Updated: Apr 27, 2023
Overview What is a query string? In the world of JavaScript and web development, a query string is a set of characters tacked onto the end of a URL. The query string begins after the question mark (?) and can include one or more......
JavaScript: How to randomly change background color
Updated: Apr 10, 2023
Overview In this article, we will create a sample webpage whose background color is randomly changed when a button gets clicked or when the page is refreshed. We will get the job done by only using JavaScript, HTML, and......
JavaScript: “I agree to terms” checkbox example
Updated: Apr 10, 2023
In most websites and apps, there is an “I agree to terms and conditions” checkbox (the phrase in the quotes may differ slightly) at the registration screen. This is a method of protecting their business by requiring that......