Found 6685 Articles for Javascript

How to control fps with requestAnimationFrame?

Shubham Vora
Updated on 04-May-2023 16:56:48

718 Views

The fps word is generally associated with videos and games where we require to use animations. The fps is an abbreviation of frames per second, and it means how many times it’s rerendering the current screen. For example, a video is a continuous row of images. It means it shows images in very short intervals so that users can’t know it's showing images individually. If we decrease the fps for video, it can look like image animation rather than video. So, with more fps as it gives better results. Basically, fps tells us how many times it should update the ... Read More

How to Configure Mouse Wheel Speed Across Browsers using JavaScript?

Shubham Vora
Updated on 04-May-2023 16:53:48

4K+ Views

We can use JavaScript to change the behavior of the web page. Every browser has a default scrolling speed when users scroll using the mouse wheel. However, we can control it using JavaScript. We can also use the mouse wheel to zoom in and out of web pages. In such cases, we require to reduce the mouse wheel speed. Furthermore, developers sometimes require a scrolling speed limit, such as on website rules, so that users can read it properly. In this tutorial, we will learn different ways to control the mouse's wheel speed. Syntax Users can follow the syntax below ... Read More

How to switch between multiple CSS stylesheets using JavaScript?

Mohit Panchasara
Updated on 03-May-2023 17:11:52

1K+ Views

In this tutorial, we will learn to switch between multiple CSS stylesheets using JavaScript. Have you ever thought that when you toggle the theme of TutorialsPoint’s website, how it changes the CSS of the whole website? Here is a simple answer. When the user presses the button, it switches the CSS stylesheets for the website like it removes the stylesheet for the white theme and adds the stylesheet for the dark theme. Here, we will see examples of switching between multiple CSS files using JavaScript. Syntax Users can follow the syntax below to switch between multiple CSS files using JavaScript. ... Read More

JavaScript String Prototype Property

Mohit Panchasara
Updated on 03-May-2023 15:34:20

774 Views

In JavaScript, every object has its own properties, and each object contains the prototype property. The string is also an object in JavaScript. So, it also contains the prototype property. The prototype property is nested in the object, meaning every prototype property contains another prototype property. The string object’s prototype property contains the default methods and properties. However, developers can customize the prototype property and add methods and properties to the string prototype. In this tutorial, we will learn to use the methods of string prototype property and customize them. Syntax Users can follow the syntax below to add any ... Read More

JavaScript Program for Pairwise Swapping Elements of a Given Linked List

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:43:24

167 Views

In this tutorial, we are going to learn about a JavaScript Program for Pairwise Swapping Elements of a Given Linked List. One common operation on linked lists is swapping adjacent elements in pairs. This operation can be useful in various scenarios, such as reorganizing data, rearranging elements in a specific order, or optimizing certain algorithms. Also, we will focus on solving the problem of pairwise swapping elements in a given linked list using JavaScript. We will provide a step-by-step approach to implementing the algorithm, explaining the logic and code behind it. By the end of this tutorial, you will have ... Read More

JavaScript Program for Pairs such that one is a power multiple of other

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:41:58

83 Views

JavaScript Program for pairs such that one is a power multiple of the other is a problem that involves finding pairs of numbers such that one number is a power multiple of the other. In this tutorial, we will be discussing how to write a JavaScript program to solve this problem. We will be exploring various approaches and algorithms to find these pairs efficiently. Additionally, we will also be discussing the time and space complexity of these algorithms to provide a comprehensive understanding of the topic. So, let's dive in and learn how to write a JavaScript program to find ... Read More

JavaScript Program for Number of unique triplets whose XOR is zero

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:39:10

143 Views

JavaScript Program for the Number of unique triplets whose XOR is zero is a common programming problem that requires finding the number of unique triplets in a given array whose XOR is equal to zero. The XOR operation is a bitwise operator that takes two bits and returns 1 if the bits are different, and 0 if they are the same. In this problem, we need to find all possible combinations of three numbers in the array, where the XOR of the triplet is zero. This problem can be solved using various approaches, including brute force, hashing, and sorting. In ... Read More

JavaScript Program for Number of local extrema in an array

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:38:50

84 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. In this problem, we are required to find the number of local extrema in an array using JavaScript. Local extrema are the peaks and valleys in a sequence of numbers. They are the points where the values change from increasing to decreasing or from decreasing to increasing. Finding the number of local extrema in an array can be a challenging task, but it is an essential step in many data analysis applications. In this tutorial, we ... Read More

JavaScript Program for Mirror of matrix across diagonal

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:15:58

238 Views

JavaScript Program for the Number of pairs with maximum sum is a common coding problem that involves finding the number of pairs in an array that have the maximum sum. This problem can be solved using various approaches, including brute-force, sorting, and hash tables. In this tutorial, we will discuss a simple and efficient approach using hash tables to solve this problem. We will explain the logic behind the solution step-by-step and provide a detailed implementation in JavaScript. Additionally, we will analyze the time and space complexity of our solution and discuss possible optimizations. This tutorial assumes basic knowledge of ... Read More

JavaScript program for Minimum Product Subset of an Array

Aishwarya Mani Tripathi
Updated on 02-May-2023 17:09:03

170 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. In this ... Read More

Advertisements