Javascript Articles

Page 498 of 534

Javascript search for an object key in a set

Disha Verma
Disha Verma
Updated on 15-Mar-2026 506 Views

In JavaScript, to search for an object key in a Set, you need to understand how Sets store values and how objects behave in JavaScript. JavaScript Sets are useful objects that store unique values, making them excellent for handling distinct data. In this article, we'll explore different ways to search for an object key in a Set. JavaScript Set A Set in JavaScript is a collection of unique values. Values like numbers and strings can be compared directly, but objects are stored by reference. This means that even if two objects have the same properties, they are still ...

Read More

Why is isNaN(null) == false in JS?

Disha Verma
Disha Verma
Updated on 15-Mar-2026 906 Views

The isNaN() function in JavaScript is used to check whether a given value is NaN. This function converts the argument to a number first, then checks if it's NaN. When you pass null to isNaN(), it returns false, which can be surprising. This happens because of JavaScript type coercion when using isNaN(). In this article, we will understand why isNaN returns false for null. Understanding isNaN and Type Coercion Before moving forward, you need to understand these key concepts: isNaN() Function: The isNaN() function is used to check whether a given value ...

Read More

Spread operator in function calls JavaScript

Disha Verma
Disha Verma
Updated on 15-Mar-2026 901 Views

The spread operator in function calls enhances the function parameter handling. The spread operator allows you to expand an array or any iterable across zero or more arguments in a function call. This article will guide you on using the spread operator in a function call. The spread operator is a powerful feature of JavaScript that allows one to perform operations for complex and lengthy code in a simple single line of code. The spread operator is denoted by the (...) (triple dot) symbol. Syntax The basic syntax of spread operator for function calls is mentioned below: ...

Read More

Set JavaScript object values to null?

Disha Verma
Disha Verma
Updated on 15-Mar-2026 6K+ Views

Setting object values to null can help reset data, free up memory, or show that a value is no longer needed. In JavaScript, the null value is used to indicate that there is an intentional absence of any object value. This article provides various methods for setting JavaScript object values to null and what that means. Setting an Object's Values to null Setting object values to null can be done in two types: For Specific Object Value For Multiple Object Values For Specific Object Value ...

Read More

How to create an array of integers in JavaScript?

Alshifa Hasnain
Alshifa Hasnain
Updated on 15-Mar-2026 18K+ Views

In this article, we will learn to create an array of integers in JavaScript. The Array parameter is a list of strings or integers. When you specify a single numeric parameter with the Array constructor, you specify the initial length of the array. The maximum length allowed for an array is 4, 294, 967, 295. Different Approaches The following are the two different approaches to creating an array of integers in JavaScript − Using Array Literals Using the Array Constructor Using Array Literals One of ...

Read More

JavaScript Remove non-duplicate characters from string

Disha Verma
Disha Verma
Updated on 15-Mar-2026 593 Views

Non-duplicate characters in a string are those that appear only once and do not repeat within the string. Sometimes in JavaScript, we need to work with strings and manipulate them based on certain conditions. One common task is to remove characters that only appear once in a string, keeping only the characters that appear more than once. In this article, we will understand how to remove non-duplicate characters from a string in JavaScript. Understanding the Problem Suppose we have a string like "teeth_foot". We want to remove all characters that appear only once, keeping only characters that appear multiple ...

Read More

Arrays vs Set in JavaScript.

Alshifa Hasnain
Alshifa Hasnain
Updated on 15-Mar-2026 3K+ Views

In this article, we will learn about the difference between an array and a set in JavaScript. Arrays are used to store ordered collections of elements, whereas Sets store only unique values in an unordered collection. What is an Array? An Array is an ordered, indexed collection of values in JavaScript. It allows duplicate values and provides various built-in methods to manipulate elements. Syntax let numbers = [1, 2, 3, 4, 5]; What is a Set? A Set is an unordered collection of unique values in JavaScript. Unlike arrays, a Set automatically ...

Read More

JavaScript reduce sum array with undefined values

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

If you're working with arrays in JavaScript, you may encounter situations where your array contains undefined values. This can happen when you're processing data from various sources or working with incomplete datasets. One common problem developers face is summing the values of an array with undefined elements. JavaScript's reduce() method is a versatile tool that can help you solve this problem efficiently. What is the reduce() Method in JavaScript? The reduce() method in JavaScript is a powerful tool that allows you to iterate over an array and accumulate a single result. It takes a callback function as its ...

Read More

How to stream large .mp4 files in HTML5?

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 1K+ Views

Streaming large MP4 files in HTML5 requires proper video encoding and server configuration to enable progressive download while the video plays. Video Encoding Requirements For HTML5 streaming, MP4 files need special encoding where metadata is moved to the beginning of the file. This allows browsers to start playback before the entire file downloads. Using mp4FastStart The mp4FastStart tool relocates metadata to enable streaming: // Command line usage mp4faststart input.mp4 output.mp4 Using HandBrake HandBrake video encoder includes a "Web Optimized" option that automatically prepares MP4 files for streaming by moving the metadata ...

Read More

How to make a Website step by step?

Ali
Ali
Updated on 15-Mar-2026 1K+ Views

A website is a collection of web pages containing content, images, videos, and other elements, accessible through a unique domain name and hosted on a web server. Creating a website involves several key steps from planning to deployment. Step 1: Choose and Register a Domain A domain is the web address users type to access your website (e.g., www.tutorialspoint.com). Each domain is unique and serves as your website's identity on the internet. Purchase a domain name from registrars like GoDaddy, Namecheap, or other hosting companies. Here's how a domain appears in the browser address bar: ...

Read More
Showing 4971–4980 of 5,340 articles
« Prev 1 496 497 498 499 500 534 Next »
Advertisements