Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
JavaScript Program for Writing A Function To Get Nth Node In A Linked List
Linked list is a linear data structure where nodes are connected by storing the address of the next node. Finding the nth node means retrieving the value at the nth position in the linked list, which can be accomplished using iterative or recursive methods. Problem Example Given linked list: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> null Node to find: 3rd position Output: 3 Explanation: The value at the 3rd position is 3. Using Iterative Approach This approach traverses the linked list using a ...
Read MoreHow to check if one date is between two dates in JavaScript?
In JavaScript, we can use the Date() object to create different timestamps. Also, we may be required to check if one date is between two using JavaScript. For example, we want to create a filter for orders in the eCommerce application based on the dates. So, we should be able to filter all orders between the two dates that users enter into the date input field. Another real-world use case of checking one date between two is in the banking application. For example, while developing the banking system application, developers need to create a filter allowing users to ...
Read MoreJavaScript Program for Counting sets of 1s and 0s in a binary matrix
Counting sets of 1s and 0s in a binary matrix can be achieved using nested for loops with conditional statements. A binary matrix is a matrix that consists of only two digits: 1 and 0. In this article, we will write a JavaScript program for counting the sets of 1s and 0s in a given binary matrix by counting non-empty subsets in each row and column. Understanding the Formula For any set with n elements, the total number of non-empty subsets is 2^n - 1. Let us consider a set {a, b} having 2 elements ...
Read MoreAdvanced JavaScript Tooling: Webpack, Babel, and ESLint
In today's rapidly evolving web development landscape, JavaScript has emerged as the backbone for building interactive and dynamic web applications. As JavaScript applications grow in complexity, developers face the challenge of managing and optimising their code effectively. This is where advanced JavaScript tooling comes into play. In this article, we will explore three indispensable tools for modern JavaScript development: Webpack, Babel, and ESLint. These tools work seamlessly together to enhance code quality, optimise performance, and enable the use of cutting-edge JavaScript features across different environments. Webpack: Bundling Your Code Webpack serves as a powerful module bundler that allows ...
Read MoreHow to create a FAQ page using JavaScript
A Frequently Asked Questions (FAQ) page is essential for websites, helping users find answers to common questions quickly. This tutorial shows how to create an interactive FAQ page using JavaScript with an accordion-style interface. Overview FAQ pages reduce support requests by providing instant answers to common questions. The most effective approach is using an accordion component where questions can be clicked to reveal or hide answers. Approach We'll create an accordion-style FAQ using HTML structure, CSS styling, and JavaScript functionality. Each FAQ item will toggle between expanded and collapsed states when clicked. Implementation Steps ...
Read MoreHow to Convert CSV File to JSON in JavaScript?
CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) are two popular data formats. CSV is ideal for tabular data storage, while JSON is widely used in web applications. Converting CSV to JSON in JavaScript is a common requirement when working with data manipulation and API integrations. Understanding CSV and JSON Formats CSV Format: Data is stored in rows with values separated by commas. Each row represents a record, and the first row typically contains column headers. name, age, city Pankaj, 20, Surat Neeraj, 18, Raipur JSON Format: Data is represented as an array of ...
Read MoreHow to check if the string contains only digits in JavaScript?
We may require to find the string, which contains only digits but not any other characters while developing. The easiest way to check can parse the numbers from the string and compare its length with the original string's length. If both are the same, that means the string contains only digits. Users can use the parseInt() method to parse the numbers from the string. However, in this tutorial, we will learn other methods to check if the string contains only digits in JavaScript. Using the for-loop and charCodeAt() Method We can iterate through the string using the ...
Read MoreJavaScript Program for Finding a Triplet from Three Linked Lists with a Sum Equal to a Given Number
In this article, we are going to implement a JavaScript program for finding a triplet from three linked lists with a sum equal to a given number. This problem is a variation of the standard three-sum problem but applied to linked lists instead of arrays. Problem Statement Given three linked lists and a target number, we need to find if there exists a triplet (one element from each list) whose sum equals the target number. If such a triplet exists, return true; otherwise, return false. Example: Target: 10 List 1: 1 → 2 → 3 ...
Read MoreHow to throw an error in an async generator function in JavaScript ?
Async generator functions combine asynchronous operations with generator functionality. When errors occur in async generators, they need special handling using throw() method or try-catch blocks with for await...of loops. What are Async Generator Functions? Async generators use async function* syntax and can yield values asynchronously. They return an async iterator that can be consumed with for await...of loops. Basic Async Generator Example let content = document.getElementById('content'); ...
Read MoreJavaScript Program to Check horizontal and vertical symmetry in binary matrix
In this article, we will learn to create a program to check both horizontal and vertical symmetry in a binary matrix in JavaScript. A binary matrix is a 2-D array that consists of one and zero only as the elements in each cell. Horizontal symmetry of a binary matrix means if the first row is the same as the last row, the second row is the same as the second last row, and so on. What are Symmetry Matrices? Symmetry in matrices refers to how the values in the matrix mirror themselves along an axis. In the ...
Read More