Saurabh Anand has Published 21 Articles

JavaScript Program for Equilibrium Index of an Array

Saurabh Anand

Saurabh Anand

Updated on 07-Apr-2025 14:22:46

760 Views

To write a JavaScript program for equilibrium index of an array, we are going to discuss three different approaches with detailed explanation and example codes. The equilibrium index of an array is the position where the sum of the elements to its left and right equals one another. In this ... Read More

JavaScript Program to Find k Pairs with Smallest Sums in Two Arrays

Saurabh Anand

Saurabh Anand

Updated on 04-Dec-2024 16:40:53

312 Views

To find k pairs with smallest sums in two arrays in Javascript, we will be using sorted arrays in ascending order. We are going to discuss two different approaches with stepwise explanation and examples. In this article we are having two arrays and a value of k, our task is ... Read More

ES2022 JavaScript at() Method

Saurabh Anand

Saurabh Anand

Updated on 04-Dec-2024 14:40:23

243 Views

JavaScript is a powerful and versatile programming language that is widely used for both front-end and back-end development. One of the features that makes JavaScript so powerful is its extensive standard library, which includes many built-in methods for working with strings, arrays, and other data types. One such method is ... Read More

JavaScript Program for Find the smallest missing number

Saurabh Anand

Saurabh Anand

Updated on 10-Apr-2023 13:56:51

359 Views

We are given a sorted array of distinct non-negative integers, here we have to find the smallest missing number. Hence in this tutorial, we will explore different methods to solve this problem and discuss their time complexities with various examples. Understanding the Problem The problem statement is quite simple. Given ... Read More

How to create a function `generateSelector` to generate CSS selector path of a DOM element ?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:38:14

327 Views

The generateSelector method is a helpful tool for determining the path to a specific portion of a website known as a DOM element. Understanding how CSS selectors work and how to build them can be useful in a variety of situations, such as testing automation or the construction of shortcuts ... Read More

How to create a button that submits a form and downloads a pdf simultaneously?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:33:07

3K+ Views

By using HTML, JavaScript and jsPDF, we can create a button that can submit the form and download a pdf simultaneously. We will use HTML to create a form, JavaScript to handle the submission process and jsPDF to generate the PDF document. The act of submitting a form and getting ... Read More

How to Create a Bootstrap Spinner and Display on Screen till the data from the API loads ?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:31:43

8K+ Views

Using Bootstrap, we will create a Bootstrap spinner and display it on the screen until data from an API is loaded. This will give customers visual indications that something is going on in the background and can be an excellent method to improve the user experience. In this blog, we ... Read More

How to Create a Binary Calculator using HTML, CSS and JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:29:03

1K+ Views

A binary calculator is a program that performs mathematical calculation on binary numbers. Now, as of you remember the binary numbers are those numbers which are formed from only two numbers i.e., 0 and 1. In this blog, we will use this program to calculate addition, subtraction, multiplication and division ... Read More

How to create 3D Geometries in webGL and p5.js?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:27:50

814 Views

Creating 3D geometries in webGL and p5.js is a powerful way to create interactive and visually interesting web applications. With the ability to create basic shapes, add textures, lighting, and materials, and transform 3D geometries, we can create a wide range of 3D graphics and animations. By understanding the basics ... Read More

How to count the number of times a button is clicked using JavaScript?

Saurabh Anand

Saurabh Anand

Updated on 21-Feb-2023 17:26:33

17K+ Views

Tracking button clicks is a common task in JavaScript and can be achieved by using the addEventListener() method. By adding an event handler method to the button element and incrementing a variable each time the button is pressed, we can simply keep track of button clicks. We can quickly show ... Read More

Advertisements