Prototype Property in Javascript Object

Prototype property of object points to another object in javascript.
We will see how we can use the prototype property

Now you can call the getDiscount() to get the discount
>console.log("Discount is "+p.getDiscount())
>Discount is 0.05

Leave a Reply

Your email address will not be published. Required fields are marked *