Found 6685 Articles for Javascript

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

How to create an array with multiple objects having multiple nested key-value pairs in JavaScript?

Tarun Singh
Updated on 13-Apr-2023 13:48:57

5K+ Views

JavaScript is a versatile language that is widely used for creating dynamic web applications. One of the most common data structures used in JavaScript is the array. An array is a collection of elements that can be of any type, including objects. In this article, we will discuss how to create an array with multiple objects having multiple nested key-value pairs in JavaScript. What are arrays? An array is a special type of object that stores a collection of values. These values can be of any data type, such as numbers, strings, booleans, and even other arrays. Arrays are a ... Read More

JavaScript Program for Rotate a Matrix by 180 degrees

Prabhdeep Singh
Updated on 12-Apr-2023 12:25:24

210 Views

A square matrix is a kind of 2-D array with an equal number of rows and columns and we have to rotate the matrix by 180 degrees anticlockwise. Rotating a matrix anti-clockwise means first converting all the rows into columns and the first row will be the first column and then again rotating the rows into columns and the first row will be the first column and so on. Let’s see an example − Input 1: N = 3 Matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] Output 1: ... Read More

JavaScript Program For Reversing Alternate K Nodes In A Singly Linked List

Prabhdeep Singh
Updated on 12-Apr-2023 12:23:26

88 Views

Reversing a linked list means arranging all the nodes of the linked list in the opposite manner as they were present earlier or moving the elements present at the last of the linked list towards the head and head nodes towards the tail. Alternate K nodes reversing means reversing the first k elements and then keeping the next k elements the same and again reversing the next k elements and so on. We will see the codes with the different approaches and explanations for each of them. For example If the given linked list is the: 1 ... Read More

JavaScript Program For Reversing A Linked List In Groups Of Given Size

Prabhdeep Singh
Updated on 12-Apr-2023 12:22:20

133 Views

A linked list is a linear data structure that consists of interconnected nodes. Reversing a linked list means changing the order of all its elements. Reversing a linked list in groups of a given size means, we are given a number and we will reverse the first given number of elements, and then for the next set we will reverse the elements. We will see the proper code with implementation. Examples Given linked list: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> null Given number: 3 Output: 3 -> 2 -> ... Read More

JavaScript Program for Reversal algorithm for right rotation of an array

Prabhdeep Singh
Updated on 12-Apr-2023 12:21:05

146 Views

Right rotation of an array means to rotate the elements of the array to their right side by a given number of times and for the number which are present at the edge they will move to the first index in their right rotation by assuming an array in a cycle form. We will implement a proper code to implement the algorithm with an explanation. Example Let us assume we have given array as [1, 2, 3, 4, 5, 6, 7, 8, 9] The number of right rotations of the array is 3 Output: 7 8 9 1 2 ... Read More

JavaScript Program for Reversal algorithm for array rotation

Prabhdeep Singh
Updated on 12-Apr-2023 12:19:55

160 Views

An array is a linear data structure used to store the different types of objects and we are given an array of size n and an integer k (where k is the number by which we will rotate an array). We will rotate the array by k elements and then return the rotated array. Rotation means we have to traverse the array from the given kth element and shift all the integers by one and we have to shift each element by 1 till the kth element came to position ‘0’ or we can say at index number ‘0’. Note ... Read More

JavaScript Program for Removing Duplicates From An Unsorted Linked List

Prabhdeep Singh
Updated on 12-Apr-2023 12:18:55

174 Views

The linked list is a linear data structure that consists of nodes, and each node is stored in memory in a non-contiguous manner. Nodes are connected by storing the address of the next node. We are given a linked list that will contain some integers in a random manner and not in a sorted manner. The task is to find the elements of the linked list which are repeated and we have to remove the duplicated ones. We will see the proper code and explanation. In this problem, we will keep the first copy of the elements of the ... Read More

Javascript Program For Removing Duplicates From A Sorted Linked List

Prabhdeep Singh
Updated on 12-Apr-2023 12:17:02

260 Views

Linked list is linear data structure and we have given a sorted linked list that consists of the integers. There are some numbers that may be duplicated or repeated and we have to remove them. As the given linked list is sorted, we can simply iterate over it and by using the while loop can remove the duplicate nodes from it. We will implement a proper code to understand the logic better with the discussion of time and space complexity. Example Given linked list is: 1-> 2 -> 2 -> 3 -> 4 -> 4 -> 4 -> 5 -> ... Read More

Javascript Program for Range Queries for Frequencies of array elements

Prabhdeep Singh
Updated on 12-Apr-2023 12:15:19

101 Views

We are given an array that will contain integers and another array will be given that will contain the queries and each query represents the range that we are given by the leftmost and the rightmost index in the array and an element. For that range or the subarray, we have to find the frequency of the given element present in that range. The frequency of the elements means that we have to tell for each integer present in that range how many times it occurs. For example − If, the given array is: [5, 2, 5, 3, 1, 5, ... Read More

Advertisements