Sling Academy
Home/JavaScript/Page 76

JavaScript

JavaScript: Detect when a Div goes into viewport

Updated: Feb 19, 2024
Overview Understanding how to detect when a div element or any other element becomes visible in the viewport can be incredibly useful for a variety of web development tasks, such as lazy loading images or triggering animations only......

JavaScript Promise.any() method (basic and advanced examples)

Updated: Feb 19, 2024
Overview In the realm of asynchronous operations in JavaScript, Promise.any() is a relatively new addition that provides a means of handling multiple promises. This method takes an iterable of Promise objects, and as soon as one of the......

Using logical nullish assignment in JavaScript (with examples)

Updated: Feb 19, 2024
Overview The concept of “nullish” values in JavaScript, which includes the values null and undefined, plays a crucial role in handling the absence of value in a more controlled manner. To augment this concept, ES2020......

Understanding WeakRef in JavaScript (with examples)

Updated: Feb 19, 2024
Overview JavaScript, a language known for its dynamic nature, offers several mechanisms to manage memory efficiently. One such feature, introduced in the ECMAScript 2021 specification, is the WeakRef class. This tutorial aims to......

JavaScript Numeric Separators: Basic and Advanced Examples

Updated: Feb 19, 2024
Introduction In modern JavaScript, readability is key. One feature that enhances readability, especially when dealing with large numbers, is the Numeric Separator. This feature allows developers to write numeric literals in a more......

JavaScript: How to Identify Mode(s) of an Array (3 Approaches)

Updated: Feb 19, 2024
Overview Identifying the mode of an array, which refers to the element(s) that appear most frequently, is a common task in data analysis and statistics. In JavaScript, we can implement several solutions to find the mode(s). This guide......

JavaScript: Using AggregateError to Handle Exceptions

Updated: Feb 14, 2024
Handling exceptions efficiently and effectively is crucial in any programming environment, and JavaScript is no exception. With the introduction of AggregateError, JavaScript developers have a more versatile way to handle multiple errors......

JavaScript FinalizationRegistry: Explained with Examples

Updated: Feb 14, 2024
In modern JavaScript development, managing memory and ensuring efficient garbage collection is crucial for building high-performance applications. One of the less commonly understood features introduced in recent versions of JavaScript is......

JavaScript String replaceAll() method (with examples)

Updated: Feb 14, 2024
Overview The replaceAll() method in JavaScript is a powerful tool for string manipulation, allowing developers to replace all occurrences of a substring within a given string with another substring. This method is relatively new,......

Nullish CoalescingĀ in JavaScript: A Developer’s Guide

Updated: Feb 14, 2024
With the ever-evolving landscape of JavaScript, it’s crucial for developers to stay abreast of the latest features and enhancements that the language offers. One such feature, introduced in ECMAScript 2020 (ES11), is the Nullish......

JavaScript Promise.allSettled() method (with examples)

Updated: Feb 14, 2024
Overview Understanding the asynchronous behavior of JavaScript is crucial for modern web development. One of the key aspects of managing asynchronous operations in JavaScript is the use of Promises. Promises provide a way to handle the......

JavaScript: Checking if the current window is a popup

Updated: Feb 14, 2024
Introduction In web development, managing window behavior is crucial for improving user experience and for certain functionalities. One common scenario is determining whether the current window is a popup. A popup window is usually a......