Lokesh Yadav has Published 52 Articles

How to convert a JSON string into a JavaScript object?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:11:36

3K+ Views

In this article we are going to discuss how to convert a JSON string into a JavaScript object with suitables examples in JavaScript. There are two possible ways to convert a JSON string into a Javascript object – eval() and parse(). The usage of eval() method is unsafe and not ... Read More

How to convert a value to a number in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:18:08

3K+ Views

In this article we are going to discuss how to convert a value to a number in JavaScript. JavaScript has introduced Number(), parseInt(), parseFloat() methods to convert a value into a number and also we can achieve it by using (+) unary operator. These mentioned methods can convert number strings ... Read More

How to find the cube root of a number in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:16:58

3K+ Views

In this article we are going to discuss how find the cube root of a number with the help of suitable examples in JavaScript. Using Math object in JavaScript any kind of operation can be done. Math.cbrt(), Math.pow() are the methods especially used to find the cube root of a ... Read More

How to set dynamic property keys to an object in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:13:41

2K+ Views

In the following example we are going to learn how to set dynamic property keys to an object in JavaScript. To add dynamic property keys to an object in JavaScript, there are three possible ways. There are three possible ways to set dynamic property keys to an object. The first ... Read More

How to access an object value using variable key in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:12:01

12K+ Views

In this article we are going to discuss how to access an object value using variable key in JavaScript. An object value can be accessed by a Dot Notation and a Bracket Notation. To get the object value through a variable key, the value or expression inside the bracket notation ... Read More

How to convert a value into Boolean in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:10:12

605 Views

In this article we are going to discuss how to convert a value into Boolean in JavaScript. In JavaScript programming we sometimes need values like these ‘YES / NO, ‘ON / OFF’, ‘TRUE / FALSE’. So, JavaScript provides Boolean() method, which helps us to convert a value into Boolean. A ... Read More

How to find the action attribute and method of a form in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:08:51

2K+ Views

In this article we are going to learn how to find the action attribute and method of a form with suitable examples in JavaScript. In HTML, there is  element which has few attributes: input, label, text area, select, name, target. The action and method attributes of the form are used ... Read More

How to display the date and time of a document when it is last modified in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:04:49

2K+ Views

In this article we are going to discuss how to display the date and time of a document when it is last modified in JavaScript. It is important to know the last updated date and time of a web document, when you read some content on the web, to know ... Read More

How to find the accept-charset and enctype attribute of a form in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:03:14

252 Views

In this article we are going to discuss how to find the accept-charset and enctype attribute of a form in JavaScript. In HTML, there is a element which has few attributes − input, label, text area, select, name, target. The accept-charset is used to return the set of one ... Read More

How to find the name and the target of a form in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 08-Dec-2022 08:01:44

975 Views

In this article we are going to learn how to find the name and the target of a form in JavaScript. In HTML, there is element which has few attributes: input, label, text area, select, name, target. The name and target attributes of form are used to find those ... Read More

Advertisements