Shubham Vora has Published 962 Articles

How to get the number of forms in a document with JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2022 08:47:27

895 Views

In this tutorial, we will learn how to get the number of forms in a document using JavaScript. Since different methods are used to create forms in an HTML document, it might get tricky to get the number of forms present. However, you can use some methods to count the ... Read More

How to get the natural logarithm (base E) of a number in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2022 08:36:43

297 Views

In this tutorial, we will learn how to get the natural logarithm of a number in JavaScript using Math.log() and Math.LN methods Since finding out the natural logarithm of a number through calculation is difficult, the methods like Math.log() and Math.LN is considered useful in JavaScript. You can use these ... Read More

How to get the length of a string in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2022 08:32:15

3K+ Views

In this tutorial, we will learn how to get the length of the string in JavaScript. While writing any string in JavaScript, we might need to know the number of characters present in it. By knowing an easy method to calculate the length of a string in JavaScript, we ... Read More

How to get the port number part of the href attribute of an area in JavaScript?

Shubham Vora

Shubham Vora

Updated on 14-Sep-2022 08:26:37

293 Views

In this tutorial, we will discover how to get the port number of the href attribute of an area in JavaScript. An area is a tag in JavaScript. This tag is written as . This tag denotes an area inside an image map. This tag has no closing tag. So ... Read More

How to remove an item from JavaScript array by value?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:24:47

408 Views

In this tutorial, we will learn to remove an item from a JavaScript array by value. An array is a data structure that can store a collection of data with the same data type. A contiguous memory location is allocated to the array elements. Each array element is identified by ... Read More

How to get the cosine of a number in JavaScript?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:17:27

460 Views

In this tutorial, we will learn how to get the cosine of a number in JavaScript. The cosine cos (x) function is a fundamental function used in trigonometry (the others being the cosecant, cotangent, secant, sine, and tangent). The cosine of an angle is commonly defined as the ratio between ... Read More

How to remove a property from a JavaScript object?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:15:55

2K+ Views

In this tutorial, we will look at a few methods to remove a property from a JavaScript object. And compare them to understand which one is suitable in a given context. Let's move forward to discuss this. Using the delete Operator Here, the delete operator removes the keys from the ... Read More

How to get the arctangent of the quotient of its arguments in JavaScript?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:08:52

144 Views

In this tutorial, we will learn how to get the arctangent of the quotient of its arguments in JavaScript. The JavaScript math object has several constants and methods for performing mathematical operations. It does not have constructors, unlike the date object. JavaScript Math is one of the built-in objects that ... Read More

How to register events in JavaScript?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:06:20

2K+ Views

The interaction between HTML and JavaScript is handled through events. When a user accomplishes some action on the page, an event occurs. In this tutorial, we will learn how to register events in JavaScript. Let’s move forward to discuss this further. Using Inline Event Handlers Added as HTML Tag Attributes ... Read More

How to randomize (shuffle) a JavaScript array?

Shubham Vora

Shubham Vora

Updated on 06-Sep-2022 14:00:53

2K+ Views

In this tutorial, we will learn the methods to randomize or shuffle a JavaScript array. We can achieve this by using existing shuffle functions in some libraries or algorithms. Let’s move forward to discuss this. Using the Fisher-Yates Algorithm and Destructuring Assignment Here, the algorithm iterates through the array from ... Read More

Advertisements