VOOZH about

URL: https://www.geeksforgeeks.org/javascript/javascript-object-prototypes/

⇱ JavaScript Object Prototypes - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

JavaScript Object Prototypes

Last Updated : 8 Jun, 2026

JavaScript prototypes are used to access the properties and methods of objects. Inherited properties are originally defined in the prototype or parent object. The Date object is inherited from Date.prototype, Array object inherits from Array.prototype, etc. The prototypes may be used to add new properties and methods to the existing objects and object constructor.

Syntax:

Object.prototype

Example 1: This example adds a new property to the object.


Example 2: This example adds a new method to the object.

Comment