Disha Verma

Disha Verma

45 Articles Published

Articles by Disha Verma

Page 3 of 5

Javascript search for an object key in a set

Disha Verma
Disha Verma
Updated on 15-Mar-2026 495 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 885 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

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

JavaScript algorithm for converting Roman numbers to decimal numbers

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

For converting a Roman numeral into a decimal number, JavaScript provides simple and efficient ways. Roman numerals are a number system that started in ancient Rome and are still used today in different situations. Converting Roman numerals to decimal (integer) values can be useful in many applications, such as date conversions, numbering systems, or educational tools. In this article, we will see a JavaScript algorithm to convert Roman numerals into decimal numbers efficiently. Understanding Roman Numerals Roman numerals are a number system that uses combinations of letters from the Latin alphabet to represent values. It uses seven letters to ...

Read More

How to add, access JavaScript object methods?

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

Adding and accessing object methods are common tasks in JavaScript. JavaScript objects are collections of properties and methods, and the JavaScript methods are functions associated with objects. JavaScript provides various features and ways to add and access object methods. In this article, we will understand how to add or access object methods in JavaScript. Understanding JavaScript Object Methods JavaScript methods are functions associated with objects. They allow objects to perform actions, which is important for creating dynamic and interactive programs. Methods in objects are functions that work with the object's properties. This helps make programming more organized and efficient. ...

Read More

JavaScript Count characters case insensitive

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

Counting characters in a string is a common task in programming, especially when analyzing text or creating applications that handle user input. Counting characters in a string without worrying about uppercase or lowercase letters is a common task in text processing and data analysis. JavaScript offers different methods to easily count how many times each character appears, regardless of case. Understanding Case Insensitive Case insensitivity in programming means that a system treats uppercase and lowercase letters as the same. For example, "Hello" and "hello" would be treated as ...

Read More

Spread operator in function calls JavaScript

Disha Verma
Disha Verma
Updated on 15-Mar-2026 876 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

JavaScript - Creating a Custom Image Slider

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

An image slider is a user interface component in JavaScript that allows users to view a series of images in a slideshow format. It is also known as a carousel or slideshow. An image slider consists of navigation buttons (such as next and previous buttons) that allow users to navigate from one image to the other. With the help of basic HTML for structuring and CSS for designing or making the image slider presentable, along with simple JavaScript logic, you can create an image slider efficiently. This article will guide you through creating a basic image slider with navigation ...

Read More

How to autofill a field in JavaScript same as another?

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

Automatically filling a field in JavaScript is a common requirement in web forms, where one field copies the value from another. This feature eliminates the need to write the same information in multiple fields. This is useful in real-life scenarios, such as forms where users enter a permanent address and need to add a temporary address. If both addresses are the same, using the autofill feature, they can automatically copy the permanent address to the temporary address field. This article explains how to create autofill functionality in JavaScript. Core Concept: Copying Field Values The main concept is ...

Read More

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

Disha Verma
Disha Verma
Updated on 15-Mar-2026 636 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 to create a JavaScript program that increments or decrements a variable based on specific keyboard key presses. This feature can be helpful in interactive websites, like games or tools that check user input. Table of Content You can create a JavaScript program to get a variable to count ...

Read More
Showing 21–30 of 45 articles
Advertisements