Articles on Trending Technologies

Technical articles with clear explanations and examples

JavaScript Memory Management: Memory Leaks and Performance Optimization

Mukul Latiyan
Mukul Latiyan
Updated on 15-Mar-2026 602 Views

JavaScript is a powerful and widely-used programming language that runs on the client-side of web applications. As a developer, it is essential to understand memory management in JavaScript to optimize your code for better performance. In this article, we will delve into the intricacies of memory management in JavaScript, focusing on memory leaks and performance optimization techniques. Understanding Memory Management in JavaScript JavaScript utilizes an automatic memory management system known as garbage collection. The garbage collector is responsible for allocating and deallocating memory as needed, making the developer's job easier by handling memory management automatically. However, it is ...

Read More

JavaScript Program to Count Rotations Divisible by 8

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 286 Views

In this tutorial, we'll learn how to count the number of rotations of a given number that are divisible by 8. A rotation means moving digits from one end to another - for example, rotating 123 gives us 231, 312, and back to 123. We'll explore two different approaches: the straightforward rotation method and an optimized approach using divisibility rules. Understanding Number Rotation When we rotate a number, we take the last digit and move it to the front. For example, rotating 1234 gives us these possibilities: 1234 (original) 4123 (moved 4 to front) 3412 (moved ...

Read More

JavaScript program for Minimum Product Subset of an Array

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 339 Views

JavaScript Program for Minimum product subset of an array is a common problem that arises in the field of computer science and programming. The problem statement requires us to find the minimum product that can be obtained from any subset of the given array. A minimum product subset of an array is a subset of array elements that yields the smallest possible product. Several algorithms are available for identifying this subset, including dynamic programming, greedy algorithms, and branch and bound. The selection of the algorithm is determined by the particular constraints and specifications of the problem at hand. ...

Read More

How to Configure Mouse Wheel Speed Across Browsers using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 6K+ Views

We can use JavaScript to control the mouse wheel scrolling behavior across different browsers. Every browser has a default scrolling speed, but we can customize it to create better user experiences, such as smooth scrolling animations or controlled reading speeds. Different browsers support different wheel events, so we need to handle multiple event types to ensure cross-browser compatibility. This tutorial demonstrates various approaches to configure mouse wheel speed using JavaScript. Syntax The basic syntax for controlling mouse wheel speed uses the 'wheel' event: element.addEventListener("wheel", (event) => { event.preventDefault(); ...

Read More

Count the number of nodes in a complete Binary tree using JavaScript

AYUSH MISHRA
AYUSH MISHRA
Updated on 15-Mar-2026 1K+ Views

A binary tree is a non-linear data structure where each node can have at most two children: left and right. In this article, we'll explore how to count nodes in a complete binary tree using JavaScript. What is a Complete Binary Tree? A complete binary tree is a binary tree where all levels are completely filled except possibly the last level, and the last level has all nodes filled from left to right. 1 ...

Read More

JavaScript Program to check idempotent matrix

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 240 Views

An idempotent matrix is a square matrix that has the same number of rows and columns and when we multiply the matrix by itself the result will be equal to the same matrix. We will be given a matrix and we have to find that whether it is an idempotent matrix or not. Mathematical Definition If the given matrix is M, then for M to be an idempotent matrix it should follow the property: M * M = M Matrix Multiplication Overview Multiplication of a matrix with another matrix produces another matrix and ...

Read More

JavaScript Program for Mirror of Matrix Across Diagonal

Ravi Ranjan
Ravi Ranjan
Updated on 15-Mar-2026 525 Views

To write a javascript program for mirror of matrix across diagonal, we will be discussing two approaches with their code examples and explanations. In this article we have a 2D matrix. Our task is to write a JavaScript program that creates a mirror of the matrix across its diagonal. This operation is also known as matrix transpose, where rows become columns and columns become rows. ...

Read More

Which Fields Have More Demand Now, Java or JavaScript?

Mr. Satyabrata
Mr. Satyabrata
Updated on 15-Mar-2026 2K+ Views

Java and JavaScript are two programming languages that are often compared due to their similar names. However, they are fundamentally different languages, with their own unique strengths and applications in today's technology landscape. Java is a mature language that has been around for over two decades and is widely used for enterprise-level software development. It is known for its stability, security, and cross-platform compatibility. Java's static type checking system makes it a safer option for larger software projects. On the other hand, JavaScript is a dynamic language that is primarily used for front-end web development. It enables developers ...

Read More

JavaScript Program to Check if a Given Matrix is Sparse or Not

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 365 Views

To check if a given matrix is sparse or not, we will be discussing two different approaches, their complexities, and example codes. A sparse matrix is a special type of matrix in which the number of zeroes is strictly more than half of the total number of elements present in the given matrix. In this article we are having a 2D matrix, our task is to write a JavaScript program to check if a given matrix is sparse or not. Users must be familiar with conditional statement, nested for loop and javascript methods. Example Input: Matrix: [[1, ...

Read More

JavaScript Program for Number of Local Extrema in an Array

Ravi Ranjan
Ravi Ranjan
Updated on 15-Mar-2026 351 Views

JavaScript Program for the Number of local extrema in an array is a common problem in the field of computer science and data analysis. Local extrema are the peaks and valleys in a sequence of numbers. In this article we are having two arrays, our task is to write a Javascript program for number of local extrema in an array. Local Extrema in Array [1, 2, 3, 2, 1, 4, 5, 6, 5, 4, 3, 2, 1] ...

Read More
Showing 14251–14260 of 61,297 articles
Advertisements