Lokesh Yadav has Published 52 Articles

Add a method to a JavaScript object constructor?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:41:12

2K+ Views

In this article we are going to discuss how to add a method to a JavaScript object constructor with suitable examples in JavaScript. In JavaScript adding a method to an object constructor is unlike adding a method to a normal object. We cannot add a method as it is the ... Read More

Add a property to a JavaScript object constructor?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:38:13

649 Views

In this article, we’ll go over how to add a property to a JavaScript object constructor in JavaScript with appropriate examples. Adding a property to an object constructor is different from adding a property to a normal object. If we want to add a property, we have to add it ... Read More

How to add a method to a JavaScript object?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:37:08

5K+ Views

In this article, we’ll go over how to add a method to a JavaScript object in JavaScript with appropriate examples. A JavaScript object is an entity which has properties. A property can be a variable or a method which define state and behavior of the object. A method is a ... Read More

How to encode a string in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:33:56

20K+ Views

In this article we are going to learn how to encode a string in JavaScript with appropriate examples. Encoding is the process of converting from one data format to another format. In computer science terms, encoding is the process of converting a text into a cipher text. Encoding is different ... Read More

How to check whether a number is finite or not in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:31:09

293 Views

In this article, we are going to discuss how to check whether a number is finite or not with suitable examples in JavaScript. To check whether a number is finite or not in JavaScript, there is an inbuilt method which is isFinite() method. This method returns true if the number ... Read More

Get data from sessionStorage in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:29:56

11K+ Views

Let us discuss how to get data from with suitable examples in Javascript. The sessionStorage Object is a window object property that exists in all modern browsers. Any data kept in sessionStorage is linked to the page's protocol, hostname, and port. The session storage is unique for every window. The ... Read More

Retrieve element from local storage in JavaScript?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:28:21

6K+ Views

Let us discuss how to retrieve element from local storage with suitable examples in Javascript. To retrieve elements from the local storage in Java Script, we use getItem() method which helps us to access elements that are stored in the local storage object. The getItem() method belongs to the storage ... Read More

Getters and setters in JavaScript classes?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:26:33

5K+ Views

In this article we are going to discuss about the getters and setters in JavaScript classes with suitable examples in JavaScript. In JavaScript, getters and setters are the methods that are used to get or set the value for properties. When using getters and setters, you can ensure higher data ... Read More

Another method other than a constructor in a JavaScript class?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:16:43

181 Views

In this artcle we are going to learn another method other than a constructor in a JavaScript class with suitable examples in JavaScript The Constructor is used to create and initialize an instance of a class i.e., object. The constructor's job is to build a new object and set values ... Read More

How to convert JavaScript objects to primitive data types manually?

Lokesh Yadav

Lokesh Yadav

Updated on 09-Dec-2022 05:13:04

419 Views

In this article we are going to discuss how to convert JavaScript objects to primitive data types manually with suitables examples in JavaScript. Primitive data types are nothing but a string, number, boolean, etc. To convert objects to primitive data types, javascript has provided some methods such as toString(), toDateString(), ... Read More

Advertisements