Rushi Javiya has Published 167 Articles

How to solve JavaScript heap out of memory on prime number?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 17:58:44

255 Views

As the ‘heap out of memory’ error message suggests, it occurs when any JavaScript code takes more memory than allocated memory, when we run any JavaScript program, the computer allocation particular memory to the JavaScript program. When we run code of JavaScript or any programming language, our computer creates ... Read More

How to use an HTTP GET or POST for Ajax Calls?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:19:39

8K+ Views

We need to use JavaScript, and an AJAX library like jQuery, Axios, or Fetch API to make an AJAX call using HTTP GET or POST. Ajax (Asynchronous JavaScript and XML) creates fast and dynamic web pages by updating content asynchronously without reloading the entire page. It uses JavaScript to send ... Read More

How to Sort/Order keys in JavaScript objects ?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:14:58

16K+ Views

In JavaScript, an object contains the key-value pair. Sometimes, we may require to sort the object keys. We can’t use the sort() method directly with the object as like array, as we need to sort the key-value pair of the object together rather than sorting only keys. Below, we ... Read More

How to sort rows in a table using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:13:02

2K+ Views

We can’t use the built-in sort() method of JavaScript to sort the table rows based on the particular column. So, we need to create a custom algorithm to sort table rows. In this tutorial, we will learn to sort tables and rows using JavaScript. Here, we will look at ... Read More

How to set default values when destructuring an object in JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:04:45

6K+ Views

The array and object destructuring feature was introduced in the ES6 version of JavaScript. The destructuring of the array and object allows us to store its values in a separate variable. After that, we can use that variable to access the value of the particular property of the object. ... Read More

How to set cursor style to pointer for links without href?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:03:05

3K+ Views

We can use the tag in HTML to add a link to the web page. The default cursor style for the elements is the pointer, but removing the href attribute from the tag changes the cursor style. So, in this tutorial, we will learn to keep ... Read More

How to set cursor position in content-editable element using JavaScript?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 15:00:56

11K+ Views

In HTML, content editable div allows users to edit the content of the div element. We need to pass the contenteditable attribute with true Boolean value to the div element to make any div element editable. The content editable div contains the caret cursor by default, and sometimes we ... Read More

How to send row data when clicking the button using javascript?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 14:59:49

9K+ Views

The table contains multiple rows, and every row contains multiple columns. Also, every column contains multiple HTML elements or texts. Here, we will add the submit button on every table row, and based on the button click, we will access the row's data. We will use JavaScript and jQuery ... Read More

How to create regular expression only accept special formula?

Rushi Javiya

Rushi Javiya

Updated on 22-Feb-2023 14:56:47

1K+ Views

The regular expression is a pattern containing various characters. We can use the regular expression to search whether a string contains a particular pattern. Here, we will learn to create a regular expression to validate the various mathematical formulas. We will use the test() or match() method to check ... Read More

How to use template string literal in ECMAScript 6?

Rushi Javiya

Rushi Javiya

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

274 Views

In the ES6 version of JavaScript, literals are introduced. JavaScript contains object literals, array literals, Numeric literals, RegExp literals, etc. Also, it contains the string literals. The string literal allows us to create multiline strings without any backslash characters, add any word or sentence to the quote, and add variables ... Read More

Advertisements