Objects and properties:
So, the object which is being inherited from is known as a prototype, and the inherited properties can be found in the prototype object of a constructor.
var myCar = new Object(); myCar.make = "Nissan"; myCar.model = "N-54"; myCar.year = 1972;
Let’s now create a custom “toString()” method for our user object. We can embed the function directly in the object like this:
Name: John Doe Email: firstname.lastname@example.org