JavaScript

JavaScript: Check if a string contains non-alphanumeric characters

Non-alphanumeric characters refer to any character that is not a letter (A-Z, a-z) or a digit (0-9). Examples include symbols (!, @, #), punctuation marks (., ?, :),…

JavaScript: 2 Ways to Format a String with Leading Zeros

Padding strings with leading zeros ensures consistent formatting, proper sorting, and adherence to fixed-length requirements in numeric fields, data storage, and user interfaces. This pithy, example-based article walks…

JavaScript: Remove non-alphanumeric characters from a string

Non-alphanumeric characters in JavaScript are symbols and special characters that are not letters (a-z) or numbers (0-9). They include characters like @, #, $, %, and punctuation marks…

JavaScript: Convert a String to Binary (2 Approaches)

Binary refers to the representation and manipulation of data using the base-2 number system, which uses only 0s and 1s. It is used for bitwise operations, handling binary…

JavaScript: 3 Ways to Find the Product of a Numeric Array

The product of a numeric array is the result of multiplying all the numbers within the array together. For example, the product of the array [1, 2, 3]…

JavaScript: 3 Ways to Create Multiline Strings

This practical, example-based article shows you three different ways to declare a multiline string in JavaScript. Using template literals (ES6 and newer) The main points of this approach…

Working with Typed Arrays in Modern JavaScript

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…

JavaScript: 4 Ways to Convert a Map into an Object

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…

JavaScript: Add/Remove Key-Value Pairs to/from a Map

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….

JavaScript: Convert a Map object to JSON and vice versa

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…

1 2 3 4 15