Found 10483 Articles for Web Development

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

Prabhdeep Singh
Updated on 13-Apr-2023 15:25:20

120 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. Pronic Numbers First, let us discuss pronic numbers: pronic numbers are the numbers that are the product of two consecutive numbers. Mathematically saying, if we have integer ... Read More

Javascript Program to Check if a String can be Formed From Another String by at Most X Circular Clockwise Shifts

Prabhdeep Singh
Updated on 10-Jan-2025 14:01:17

227 Views

To check if a string can be formed from another string by at most X circular clockwise shifts, we can calculate the difference of ASCII value of the characters and then compare it with the X. Circular clockwise shifts for the string mean rotating the characters of the string to their next character in alphabetic order. In this article, we are given with a string, target and a number which represent the number of circular shifts to be made. Our task is to write a JavaScript program to check if the target can be formed from the string by at ... Read More

JavaScript Program for Rotate Doubly linked list by N nodes

Prabhdeep Singh
Updated on 13-Apr-2023 15:21:21

250 Views

A doubly linked list is a linear data structure where each node stores the address of the next and previous node. We have given a doubly linked list and we have to rotate the doubly linked list by N nodes and print it. Here N is the positive number and less than or equal to the count of the nodes present in the linked list. We are not given the specific side to rotate the doubly linked list. So we will rotate the doubly linked list in both ways. Rotating Doubly Linked List to Counter Clockwise We have to rotate ... Read More

JavaScript Program to Check if a String can be Obtained by Rotating another String by 2 Places

Prabhdeep Singh
Updated on 15-Jan-2025 13:00:36

304 Views

To check if a string can be obtained by rotating another string by 2 places, we have used Javascript substr() method. We will be understanding the code with an example and step wise explanation of the code. In this article we are having two strings: str1 and str2, where str1 is the given string and str2 is the rotated string. Our task is to check if the string (str2) can be obtained by rotating another string (str1) by 2 places. Example Input: str1 = TutorialsPoint str2 = torialsPointTu Output: true (with 2 left rotations) Input: ... Read More

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

Prabhdeep Singh
Updated on 13-Apr-2023 15:18:37

195 Views

Rotating a string means moving the characters of the string to their left or right side by one index and one end may contain the value stored at the other end. We will be given two strings and we have to rotate the second string either in the left or the right direction by given number (d) times and check if both strings are equal or not. We will write proper code with comments, explanations, and detailed discussions on the time and space complexity of the program. Examples If we have the given string ‘abcdef’ and the other string is ... Read More

How to select all links inside the paragraph using jQuery?

Tarun Singh
Updated on 13-Apr-2023 14:26:17

1K+ Views

jQuery is a popular JavaScript library that simplifies HTML DOM traversal, event handling, and AJAX interactions for rapid web development. It offers a wide range of built-in functions and methods that help developers to manipulate HTML elements, styles, and behaviors dynamically. In this article, we will see how to select all links inside a paragraph using jQuery. Selecting links inside a paragraph is a common requirement when we want to modify the links in a particular section of our website, such as changing styles, finding links, etc. How to select all links inside the paragraph? Selecting links inside the ... Read More

How to select all even/odd rows in a table using jQuery?

Tarun Singh
Updated on 13-Apr-2023 14:22:11

808 Views

Working with tables is a very common task when it comes to developing web applications. And sometimes we may need to select a specific row from a table. Let’s say we want all the even or odd rows, but how to do that? In this article, we will see how to select all even/odd rows in a table with jQuery. Approaches to select all even/odd rows in the table To select all even rows in a table using jQuery, we have different approaches to achieve this task. Below we have discussed the three approaches that are commonly used in ... Read More

How to select all children of an element except the last child using CSS?

Tarun Singh
Updated on 05-Aug-2024 17:08:51

13K+ Views

To select all children of an element except the last child using CSS we will be understanding two different approaches. Each approach will be using CSS pseudo-class selectors to perform the required task. In this article, we'll see how to select all children of an element except the last child in CSS with different approaches. We will be discussing each approach in detail with examples that will help you understand how they work. Approaches to Select all Children of an Element Except the Last Child Here is a list of approaches to select all children of an element except ... Read More

How to create an Asynchronous function in JavaScript?

Tarun Singh
Updated on 13-Apr-2023 14:28:39

2K+ Views

A JavaScript asynchronous function is a function that runs independently of the main flow of the program. This allows the program continues executing other code while the async function is running. Async is used to declare an async function, which runs asynchronously, and await is used to pause the execution of the function until a specific asynchronous task is achieved. Method to create an Asynchronous function Using async keyword The simplest way to create an asynchronous function is to use the async keyword before the function declaration. See the below syntax − Syntax async function fetchData() { ... Read More

How Blazor Framework is Better Than JavaScript Frameworks?

Tarun Singh
Updated on 13-Apr-2023 14:06:19

2K+ Views

Web development is a rapidly evolving field, and Microsoft's Blazor framework is one of the latest entrants in the arena. Blazor is a client-side web framework that allows developers to build web applications using C# and .NET instead of JavaScript. While JavaScript frameworks like Angular, React, and Vue.js have been popular choices for web development for many years, Blazor offers some unique advantages that make it an attractive alternative. In this article, we will discuss how blazor framework may be considered better than JavaScript frameworks, including language familiarity, rendering, code sharing, tooling, security, etc. We’ll also know about the ... Read More

Advertisements