Javascript Articles

Page 260 of 534

How to read JSON file in JavaScript?

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

There are three effective methods to read JSON files in JavaScript using fetch(), import statements, and require(). This article covers practical examples for both browser and Node.js environments. JSON (JavaScript Object Notation) is a lightweight data interchange format that's easy for humans to read and write. In this article, we'll explore three different approaches to reading JSON files in JavaScript: Approaches to Read JSON file Using the fetch() method (Browser) Using the import statement (ES6 Modules) Using the require() method (Node.js) Each method ...

Read More

How to open link in a new window using JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 9K+ Views

If you want users to click on links and open those links in a new window because you want your user to stay on your site while they view the linked content, then you need to use this solution. By using JavaScript you can easily configure all of your links so that they open in a new window when clicked. Approach to Open Link in a New Window Using window.open() Method Using target="_blank" with onclick Using window.open() Method JavaScript window.open() method allows you to open a new ...

Read More

JavaScript Sum odd indexed and even indexed elements separately and return their absolute difference

Nikitasha Shrivastava
Nikitasha Shrivastava
Updated on 15-Mar-2026 1K+ Views

For a given list of elements, write a JavaScript program to find the sum of its odd and even indexed elements and then, calculate difference between them. To solve this problem, we will first separate odd indexed and even indexed elements. After separating them find their sum separately and store it in different variables. Now, we will calculate the difference between these sums to get desired result. Example Scenario: Input: list = [11, 21, 31, 41, 51, 61]; Output: difference = 30 Here, odd-indexed items are [21, 41, 61] and their sum is ...

Read More

JavaScript knowledge required for GTM (Google Tag Manager)

Rushi Javiya
Rushi Javiya
Updated on 15-Mar-2026 854 Views

The Google Tag Manager (GTM) is a tag management system that allows you to configure and rapidly deploy tags on your website or mobile app using a simple web-based interface. It has the same capabilities as the Google Tag, a JavaScript library used to send data from your website to Google Analytics. Tag Manager also supports tag version management and organization, community and third-party-developed tag templates, enterprise collaboration tools, and security features. JavaScript for Google Tag Manager Before you start using Google Tag Manager effectively, understanding these JavaScript fundamentals is essential: Basic ...

Read More

JavaScript: How to check if a number is even without using the modulo operator?

Shriansh Kumar
Shriansh Kumar
Updated on 15-Mar-2026 1K+ Views

For a given integer number, write a program in JavaScript to check whether a number is odd or even and return the same to the user. It's pretty easy to check whether a number is even by using the modulo operator. But, in this article, we will be checking whether a number is even or not without using the modulo operator. Using the For Loop In this approach, we are going to use the for loop to check whether a number is even or not. The idea is to take a Boolean flag variable as true and toggle ...

Read More

Creating Animated Counter using HTML, CSS, and JavaScript

Mayank Agarwal
Mayank Agarwal
Updated on 15-Mar-2026 19K+ Views

An animated counter is a display that smoothly transitions from one number to another, typically starting from 0 and counting up to a target value. This creates an engaging visual effect commonly used in dashboards, statistics displays, and landing pages. In this article, we'll create an animated counter using HTML for structure, CSS for styling, and JavaScript for the animation logic. Steps for Creating Animated Counter Follow these steps to build the animated counter: Create two div elements: one container for styling and one to display the counter value. ...

Read More

How to Become a JavaScript Developer?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 430 Views

A JavaScript developer is a programmer who specializes in creating interactive and dynamic web applications using JavaScript, the world's most popular programming language. JavaScript developers build everything from simple website interactions to complex single-page applications, mobile apps, and even server-side applications using Node.js. JavaScript developers work on both front-end development (user-facing interfaces) and back-end development (server-side logic). They collaborate with designers, other developers, and stakeholders to create responsive, user-friendly web experiences that run seamlessly across different browsers and devices. Essential Skills for JavaScript Developers To become a successful JavaScript developer, you'll need to master several core technologies ...

Read More

How to display value of textbox in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 15-Mar-2026 19K+ Views

To display value of textbox in JavaScript, you can access the user input for validation, form processing, or real-time feedback. This is essential for checking email format, password strength, and other input validation requirements. In this article, we will explore two different approaches to get and display textbox values in JavaScript using practical examples. Approaches to Display Value of Textbox Here are the main approaches to display textbox values in JavaScript that we'll cover: Using value Property Using FormData Object Using value Property The ...

Read More

How to Convert JSON String to Array of JSON Objects Using JavaScript?

Saurabh Jaiswal
Saurabh Jaiswal
Updated on 15-Mar-2026 10K+ Views

To convert JSON string to array of JSON objects using JavaScript is necessary because JSON strings cannot be directly modified or manipulated, so we need this conversion which allows us to access, modify and iterate over each item. We will be discussing three different approaches for this conversion from JSON strings to array of JSON objects. In this article we are having JSON string, our task is to convert JSON string to array of JSON objects using JavaScript. Approaches to convert JSON string to objects Here is a list of approaches to convert JSON string to array ...

Read More

ES2022 JavaScript at() Method

Saurabh Anand
Saurabh Anand
Updated on 15-Mar-2026 327 Views

JavaScript ES2022 introduced the at() method for strings, providing a more robust way to retrieve characters at specific positions. Unlike the traditional charAt() method, at() supports negative indexing and handles edge cases more gracefully. Syntax string.at(index) Where string is the target string and index is the position (zero-based). Returns the character at the specified index, or undefined if the index is out of range. Basic Usage Here's how to retrieve the first character of a string: ...

Read More
Showing 2591–2600 of 5,340 articles
« Prev 1 258 259 260 261 262 534 Next »
Advertisements