Javascript Articles

Page 17 of 534

JavaScript Program to Check if a string can be obtained by rotating another string d places

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

Rotating a string means moving characters to the left or right by a specified number of positions. We'll check if one string can be obtained by rotating another string exactly d places in either direction. Problem Understanding Given two strings and a rotation count d, we need to determine if the first string can be transformed into the second string by rotating it d positions left or right. Example String 1: "abcdef", String 2: "defabc", Rotations: 3 Left rotation by 3: "abcdef" → "bcdefa" → "cdefab" → "defabc" ✓ Approach 1: Left Rotation ...

Read More

JavaScript Program to Check if all array elements can be converted to pronic numbers by rotating digits

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

Pronic numbers are also known as rectangular numbers, the pronic numbers are numbers that are multiples of two consecutive numbers. We will be given an array of integers and we can rotate the digits in any direction for a certain number of times to get all combinations. For any combination produced by rotating the digit if each array element can be converted into the pronic number then we will print true otherwise false. What are Pronic Numbers? First, let us discuss pronic numbers: pronic numbers are the numbers that are the product of two consecutive numbers. Mathematically saying, if ...

Read More

JavaScript Program to Check if all rows of a matrix are circular rotations of each other

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

A matrix in JavaScript is a 2-dimensional array where each row contains a fixed number of elements. In this tutorial, we'll learn how to check if all rows of a matrix are circular rotations of each other, meaning we can transform any row into another through left or right rotations. Circular rotation means shifting elements: rotating [1, 2, 3] right gives [3, 1, 2], and rotating left gives [2, 3, 1]. Problem Understanding Given a matrix, we need to determine if every row can be converted to the first row through circular rotations. Example 1 ...

Read More

JavaScript Program to check if the matrix is lower Triangular

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

A matrix can be defined as a 2D array that stores elements in it and mathematically it stores the numbers in it. A Lower triangular matrix is a squared matrix that has the same number of rows and columns and all the elements that are present above the main diagonal passing from the first cell (present at the top-left) towards the last cell (present at the bottom-right) are zero. We will implement a proper code with explanation and discussion over time and space complexity. What is a Lower Triangular Matrix? A lower triangular matrix is a square matrix ...

Read More

What is the best way to learn Vanilla JavaScript?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 2K+ Views

Learning Vanilla JavaScript is essential for building a solid foundation in web development. Vanilla JavaScript refers to pure JavaScript without any frameworks or libraries like React, Angular, or Vue.js. This approach helps you understand the core language mechanics before diving into frameworks. Vanilla JavaScript vs JavaScript Frameworks Vanilla JavaScript is the core JavaScript language (ES5/ES6/ES7+) without external libraries. While frameworks like React or Angular provide pre-built solutions, vanilla JavaScript gives you complete control and deeper understanding of how things work under the hood. JavaScript is an object-oriented, interpreted scripting language that runs in browsers and adds interactivity ...

Read More

How to remove fake JavaScript pop-up messages and warnings?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 586 Views

Fake JavaScript pop-up messages and warnings are typically used for malicious purposes, such as tricking users into downloading malware or providing sensitive information. These fake popups and messages often appear to be legitimate alerts from trusted sources, such as a user's operating system, web browser, or security software, in order to deceive the user into taking a particular action. Clicking popup can forward you to malicious websites. There are several types of fake pop-ups that you may encounter while browsing the internet. Here are some of the most common types: Types of Fake Pop-ups Fake Virus Warnings ...

Read More

How to Test JavaScript Code Automatically?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 765 Views

Testing JavaScript code automatically helps ensure our code works as intended and catches bugs early in development. This article covers the main types of automated testing and popular frameworks for JavaScript applications. Types of JavaScript Testing Unit Testing Unit testing verifies individual functions, modules, or components in isolation. The goal is to test the smallest pieces of code to ensure they work correctly. Popular JavaScript unit testing frameworks include Jest and Mocha. Integration Testing Integration testing verifies how different parts of your JavaScript code work together. It ensures that various components interact properly when combined. Frameworks like ...

Read More

As a developer, how much do you use JavaScript?

Kalyan Mishra
Kalyan Mishra
Updated on 15-Mar-2026 246 Views

JavaScript is an object-oriented, interpreted scripting language that serves as the backbone of modern web development. It's primarily a client-side scripting language used to create dynamic and interactive websites. While HTML structures web content and CSS handles styling, JavaScript adds functionality like interactivity, animations, and real-time user experiences. Beyond web browsers, JavaScript has expanded into mobile application development, server-side implementation, and game development. Developers frequently use JavaScript with popular front-end frameworks like React.js, Angular.js, and Vue.js to build complex, dynamic web applications. In full-stack development, JavaScript powers both front-end interfaces and back-end services through Node.js. Why We Need ...

Read More

JavaScript Program for Maximum difference between groups of size two

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

In this program, we are given an array of integers with even length. We need to form groups of size two using array elements, then find the maximum difference between the group with the highest sum and the group with the lowest sum. Problem Statement Given an array of even length, we must partition it into groups of size two. Our goal is to find the maximum possible difference between the sum of any two groups. This means finding the highest sum group and the lowest sum group, then returning their difference. Examples Example 1: ...

Read More

JavaScript Program for Maximum equilibrium sum in an array

Prabhdeep Singh
Prabhdeep Singh
Updated on 15-Mar-2026 1K+ Views

The equilibrium sum of an array is found at an index where the sum of elements from the start to that index (inclusive) equals the sum of elements after that index. When multiple equilibrium points exist, we need to find the maximum sum among them. Problem Statement Given an array, find the maximum equilibrium sum where: Left sum includes elements from index 0 to current index (inclusive) Right sum includes elements after the current index (exclusive) Left sum equals right sum at the equilibrium point Example ...

Read More
Showing 161–170 of 5,340 articles
« Prev 1 15 16 17 18 19 534 Next »
Advertisements