JavaScript Objects The Number Object- Prototype - Javascript Objects

What is JavaScript Object - prototype?

The prototype property is used to add properties and methods to any object (Number, Boolean, String and Date etc.).

Note − Prototype is a global property which is available with almost all the objects.

Syntax:

The syntax to use Prototype is as follows.

Example

The following example tells how to use the prototype property to add a property to an object.

Output:

JavaScript Number Object Prototype Output


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Javascript Objects Topics