Found 10483 Articles for Web Development

How to Make Scrollbar Custom Arrows Work on Mobile Devices?

Yaswanth Varma
Updated on 20-Apr-2023 17:23:45

2K+ Views

You may have noticed websites with distinctive scrollbars that give them a unique feel and appearance since custom scrollbars are becoming more and more common. A custom scrollbar can simply be implemented in a few different ways. The easiest method will be used in this article, which is CSS. We employ CSS to enhance the visual appeal of web pages in our applications. Using CSS, we can now change how the scrollbar looks. Let’s see how to make scrollbar custom arrows work on mobile devices. Making scrollbar custom arrows work on mobile devices Back in the day, scrollbars on websites ... Read More

How To Modify This JavaScript Code To Grab An Image URL From A JSON File, And Display It In HTML?

Yaswanth Varma
Updated on 20-Apr-2023 17:16:40

10K+ Views

This can be done by using the JavaScript method JSON.parse() to parse through the JSON file and extract the URL of the desired image. Then, an HTML img tag can be created with a source attribute set to this URL. Finally, this img tag can be appended to an existing HTML element in order to display it on your page. This will require some knowledge of basic JavaScript syntax, as well as familiarity with how JSON is structured and parsed within it. With these skills in hand, you should have no trouble modifying your code to achieve your goal! Let’s ... Read More

JavaScript Program for Check if an array is sorted and rotated

Prabhdeep Singh
Updated on 21-Apr-2023 09:16:19

292 Views

A sorted array is an array where all the elements are present in increasing order. We have given an array of size N and an array containing the distinct integers (which means every integer is present only one time). We have to check the array is sorted and rotated in a clockwise direction. Here we have to return ‘YES’ if the array is sorted and rotated otherwise, we have to return ‘NO’. Note − Here we are talking about the sorted and rotated means at least one rotation should be present. We cannot consider a sorted array as a sorted ... Read More

JavaScript Program for Ceiling in a sorted array

Prabhdeep Singh
Updated on 21-Apr-2023 09:10:43

216 Views

An array is a linear data structure that contains the objects and in sorted array elements are present in increasing order. We have given a sorted array and an integer x. We have to print the ceiling of the integer x from the given array. The ceiling of a sorted array with value x is the smallest element larger than or equal to x, while the floor is the largest member less than or equal to x. If the ceiling of the x does not exist in the array we have to print ‘ceiling of x does not exist in ... Read More

JavaScript Program for Block Swap Algorithm for Array Rotation

Ravi Ranjan
Updated on 06-Jun-2025 19:37:06

322 Views

To implement block swap algorithm for array rotation, we will be understanding three different approaches. Rotation of the array elements means moving the elements of the given array to either the left or right side by some number of specific positions. Block swap algorithm for array rotation means to rotate the elements of the array by a given number but not using the rotation but the swapping technique. In this article we are having an array and a variable d by which array will be rotated, our task is to write a JavaScript program for block swap algorithm for array ... Read More

JavaScript Program to Check If a Singly Linked List is Palindrome

Prabhdeep Singh
Updated on 20-Apr-2023 17:19:55

306 Views

A singly linked list is a linear data structure that is stored in a non-contiguous way in the memory and each block is connected by holding the address of the next block also known as a node. A palindrome can be explained as a set of characters, digits, etc, and it reads the same from both the front and backside. We will be given a singly linked list and have to find whether the values stored at the nodes are equal from both the front and backside. Input 1 -> 2 -> 3 -> 3 -> 2 -> 1 ... Read More

JavaScript Program to Check if a Matrix is Symmetric

Prabhdeep Singh
Updated on 12-Dec-2024 12:22:52

631 Views

To check if a matrix is symmetric, we simply check if the matrix and it's corresponding transpose matrix are equal. A symmetric matrix is a special case of a matrix where both the matrix and the transpose of the matrix are the same (A = A^T). In this article we are given with an array and our task is to write a JavaScript program to check if a matrix is symmetric. Users must be familiar with 2D matrix, transpose of matrix, symmetric matrix, nested loop and if/else statement. Example Input: matrix [A]: [[1, 2, ... Read More

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

Prabhdeep Singh
Updated on 15-Dec-2024 16:29:10

258 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 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 to check idempotent matrix

Prabhdeep Singh
Updated on 20-Apr-2023 17:16:20

178 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. Mathematically − If the given matrix ix M, then of M to be an idempotent matrix is should follow the property − M*M = M Multiplication of Matrix Multiplication of a matrix with another matrix produces another matrix and if the given matrix is the square ... Read More

JavaScript Program to Count Rotations Divisible by 8

Shubham Vora
Updated on 20-Apr-2023 17:02:54

195 Views

Problem Statement − We have given a number. We need to rotate the number and need to find the total number of rotations divisible by 8. Here, we will learn two different approaches to counting rotations divisible by 8. Rotate the Number and Check if Rotation is Divisible by 8 The first approach is to rotate numbers and get every possible rotation one by one. Also, check if rotation is divisible by 8. If yes, add 1 to the count. Syntax Users can follow the syntax below to count rotations divisible by 8 by rotating the numbers. for ( ) ... Read More

Advertisements