Sling Academy
Home/JavaScript

JavaScript

JavaScript: Press ESC to exit fullscreen mode (2 examples)

Updated: Mar 02, 2024
Creating an immersive user experience often involves using the full screen capabilities of browsers. This can lead to enhanced engagement and a more focused environment for users. However, it’s crucial to allow users an easy escape......

Can JavaScript programmatically bookmark a page? (If not, what are alternatives)

Updated: Feb 22, 2024
JavaScript is a versatile language that allows web developers to interact with the Document Object Model (DOM), manage browser history, make asynchronous requests, and more. However, developers often ask if JavaScript can programmatically......

Dynamic Import in JavaScript: Tutorial & Examples (ES2020+)

Updated: Feb 22, 2024
Introduction JavaScript’s dynamic import() feature, introduced in ES2020, marks a significant advancement in how modules are handled, promising to revolutionize the way developers code and deploy applications. This tutorial aims......

JavaScript: How to implement auto-save form

Updated: Feb 20, 2024
Overview Implementing an auto-save functionality for forms in web applications enhances user experience by automatically saving form data at regular intervals or when specific events occur. In this tutorial, we’ll explore how to......

JavaScript: Disable a Button After a Click for N Seconds

Updated: Feb 19, 2024
JavaScript offers a variety of ways to enhance the user experience on the web. One common pattern is to disable a button after it has been clicked to prevent users from clicking it multiple times in a short period. This tutorial will......

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......
Page 1 of 16 Next →