JavaScript Array.toSpliced() method (with examples)
This succinct, code-centric article is about the Array.toSpliced() method in modern JavaScript. Overview The Array.toSpliced() method is a new feature that was introduced in ECMAScript 2023 (ES14). At…
JavaScript Array.toSorted() method (with examples)
This concise, practical article is about the Array.toSorted() method in modern JavaScript. Overview The Array.toSorted() method is a new feature in JavaScript (since ECMAScript 2023 or ES14) that…
JavaScript Array.toReversed() method (with examples)
This concise, straight-to-the-point article is about the Array.toReversed() method in modern JavaScript. We’ll learn the fundamentals of the method and then walk through some code examples of using…
JavaScript Array.with() method (with examples)
This concise, straightforward article is dedicated to the Array.with() method in modern JavaScript. Overview The Array.with() method was added to the programming language in ECMAScript 2021, which is…
JavaScript: Get the user’s preferred language
This concise, straightforward article shows you how to detect the user’s preferred language in their web browser by using the built-in features of modern JavaScript. What is the…
JavaScript: Check if a Year is a Leap Year (2 Ways)
Leap years are years with an extra day, February 29, to keep the calendar year synchronized with Earth’s orbit around the sun. They occur every four years, except…
JavaScript: Convert a string to Unicode code points (2 ways)
Unicode code points are the numerical values that represent each character in the Unicode standard, which covers over a million characters from various languages, scripts, symbols, and emojis….
JavaScript: Remove Multiple Consecutive White Spaces
When working with text data in JavaScript, there might be cases where you encounter a string that contains multiple consecutive whitespace characters like this: The string above look…
JavaScript: Convert String to Hex and Vice Versa
A hex value (or a hexadecimal value) is a number that is represented in base 16, using digits from 0 to 9 and letters from A to F….
JavaScript: Convert Null, NaN, Undefined, and False to Zero
When developing web applications, there might be cases you want to treat falsy values like null, NaN, undefined, and false as 0 (for instance, If you have variables…