Found 10483 Articles for Web Development

How to convert String to number using AngularJs?

Aman Gupta
Updated on 24-Mar-2023 12:19:49

6K+ Views

Overview To convert the String type value to the Number type value is easy to manipulate with AngularJs as it has in-built function such as parseInt(), parseFloat() which convert the String type of number to the Number type and “isNumber()” function of angular which cross check whether the given data is converted to the number or not. For example if a number is of type decimal String type then we will use parseFloat() function to convert the String to Number, otherwise if we had to convert without the decimal number then we will use parseInt() function. Syntax The syntax used ... Read More

How to convert speech to text using JavaScript?

Aman Gupta
Updated on 24-Mar-2023 12:16:55

18K+ Views

Overview To convert the spoken words to the text we generally use the Web Speech API’s component that is “SpeechRecognition”. The SpeechRecognition component recognizes the spoken words in the form of audio and converts them to the text. The spoken words are stored in it in an array which are then displayed inside the HTML element on the browser screen. Syntax The basic syntax used in is − let recognization = new webkitSpeechRecognition(); We can also use SpeechRecognition() instead of webkitSpeechRecognition() as webkitSpeechRecognition() is used in chrome and apple safari browser for speech recognition. Algorithm Step 1 ... Read More

How to Convert a HTML Table into Excel Spreadsheet using jQuery?

Aman Gupta
Updated on 24-Mar-2023 12:14:21

3K+ Views

Overview To convert the HTML Table into the Excel Spreadsheet can be done with the help of jQuery plugins. The “table2excel” is a lightweight plug-in of jQuery, which helps to achieve the solution to the problem. In this we will create a table using HTML tag in that we will create the number of rows using tag. The data is inserted inside the rows using the tag. Syntax The syntax used in this is − $(selector).table2excel({ filename: “”, fileext: “” }); selector − It can be any HTML ... Read More

JavaScript Program for Inserting a Node in a Linked List

Prabhdeep Singh
Updated on 17-Jan-2025 11:01:37

947 Views

To insert a node in a linked list using JavaScript, how can we do it? A linked list consists of nodes, each storing data and a reference to the next node. We can insert a new node at various positions: the beginning, a specific position, or the end of the list.. In this article, we'll guide you through how to insert a new node into a linked list in JavaScript, including adding a node at the start, a specific position, or the end. Example Input 1: list = 1 -> 2 -> 3 -> 4 -> 5 -> null; ... Read More

JavaScript Program for Frequencies of Even and Odd Numbers in a Matrix

Ravi Ranjan
Updated on 06-Jun-2025 19:11:52

262 Views

To get frequencies of even and odd numbers in a matrix, we will be discussing three different approaches. We will discuss each approach with code examples and solution of the algorithm being used. In this article we are having a 2D matrix, our task is to write a JavaScript program for frequencies of even and odd numbers in a matrix. Users must be familiar with conditional statement, nested loops and javascript operators. Example Input: Matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]; Even numbers: {2, 4, 6, 8} Odd numbers: {1, 3, 5, 7, ... Read More

JavaScript Program for Finding the Length of Loop in Linked List

Prabhdeep Singh
Updated on 24-Mar-2023 11:01:48

192 Views

In this program, we will be given a linked list that may consist of a loop and we have to find if the loop exists then what will be the size of the loop. Let’s a very famous approach to finding the length of a loop with the help of a code and discuss its time and space complexity. Introduction to Problem In this problem, as we have seen above we are given a linked list that may or may not contain a loop in it and we have to find the length of the loop if it exits ... Read More

JavaScript Program for Finding Length of a Linked List

Prabhdeep Singh
Updated on 20-Jan-2025 17:41:36

465 Views

To find the length of a linked list in JavaScript, we need to count how many nodes are present. A linked list is made up of nodes, where each node contains data and a reference to the next node. The length is determined by starting at the head and counting each node until the end of the list. If the list is empty, the length should be 0. Our task is to write a JavaScript program that calculates the length of a linked list . In other words, we need to find out how many nodes are in the ... Read More

JavaScript Program for Finding Intersection of Two Sorted Linked Lists

Prabhdeep Singh
Updated on 24-Mar-2023 10:53:38

230 Views

In this program, we are given two linked lists and we have to create a new linked list that will contain all the elements which are common in both of the lists as the lists are given sorted then we can use the concept of two pointers which are going to see in the article below. Introduction to Problem In the given problem we have to find the intersection of the given linked lists. Intersection means to get the common values from the given set of values, so here we have given two sorted linked lists from which we have ... Read More

JavaScript Program for Finding a Triplet from Three Linked Lists with a Sum Equal to a Given Number

Prabhdeep Singh
Updated on 24-Mar-2023 10:52:20

173 Views

In this article, we are going to implement a JavaScript program for finding a triplet from three linked lists with a sum equal to a given number. This problem is a kind of variation of the standard and famous three-sum problem but in a linked list manner. Let’s see the problem and implement its code along the key points of the problem. Introduction to Problem This problem is the variation of the standard problem of three sums where we are given three arrays and we have to find if there is any triplet present in the array with a sum ... Read More

JavaScript Program for Counting sets of 1s and 0s in a binary matrix

Ravi Ranjan
Updated on 06-Jun-2025 19:12:44

422 Views

Counting sets of 1s and 0s in a binary matrix can be achieved using nested for loop with conditional statement. A binary matrix is a matrix that consists of only two digits as its name suggests and those two digits are 1 and 0. In this article, we are having a 2D binary matrix having 0 and 1 only. Our task is to write a JavaScript program for counting the sets of 1s and 0s in a given binary matrix. Formula: Let us a consider a set as {a, b} having 2 elements i.e, n = 2. Total number ... Read More

Advertisements