Disha Verma has Published 63 Articles

Spread operator in function calls JavaScript

Disha Verma

Disha Verma

Updated on 17-Mar-2025 12:33:27

739 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 ... Read More

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

Disha Verma

Disha Verma

Updated on 17-Mar-2025 12:33:08

723 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 ... Read More

JavaScript Program to Find Perimeter of a Triangle

Disha Verma

Disha Verma

Updated on 17-Mar-2025 12:32:54

855 Views

The perimeter of a triangle is the sum of the lengths of its three sides. You can find the perimeter of a triangle using JavaScript by finding the sum of all sides of the triangle, as the perimeter of the triangle refers to the sum of all three sides of ... Read More

Javascript search for an object key in a set

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:09:45

416 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 ... Read More

JavaScript compile() Method

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:07:42

544 Views

The compile() method in JavaScript is a lesser-known method that has been associated with two main contexts: compiling regular expressions and validating JavaScript syntax. This method has been deprecated since JavaScript version 1.5. But developers must know about this. What is the compile() Method? The compile() method allows developers ... Read More

JavaScript code to extract the words in quotations

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:06:54

377 Views

Extracting text enclosed in quotation marks is a common task in programming, especially when working with strings that include quotes. In JavaScript, strings are a data type used to represent text. A string is a sequence of characters enclosed in single quotes ('), double quotes ("), or backticks (`). In ... Read More

JavaScript program to get a variable to count up/down on keyboard press.

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:06:03

503 Views

When working with JavaScript, handling keyboard events and creating a program that gets a variable to count up/down on keyboard press can be an essential skill. Keyboard events such as keydown and keyup in JavaScript are actions that occur when a user interacts with the keyboard. This article explains how ... Read More

JavaScript JSON.stringify() with Example

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:05:29

396 Views

In JavaScript, the JSON.stringify() method is a useful tool that converts JavaScript objects into JSON strings. This is important when dealing with APIs, storing data, or transferring information between different systems. Knowing how to use JSON.stringify() helps developers manage data transformations in their applications. In this article, we will look ... Read More

JavaScript fetch a specific value with eval()?

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:04:51

388 Views

The eval() function in JavaScript allows the execution of code stored as a string. It can be used to fetch specific values dynamically, but be careful, as it can have security risks and affect performance. This article will guide you on how to use eval() to get specific values and ... Read More

JavaScript program to update DOM

Disha Verma

Disha Verma

Updated on 13-Mar-2025 13:04:34

628 Views

JavaScript is a powerful tool for dynamically updating the Document Object Model (DOM) of a web page. The Document Object Model (DOM) is an important part of web development that allows changing the structure, content, and style of a webpage. This article explains how to update the DOM using different ... Read More

Advertisements