Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

8. Function Prototype Property > Why Care About the prototype Property?

Why Care About the prototype Property?

You should care about the prototype property for four reasons.

  1. The first reason is that the prototype property is used by the native constructor functions (e.g., Object(), Array(), Function(), etc.) to allow constructor instances to inherit properties and methods. It is the mechanism that JavaScript itself uses to allow object instances to inherit properties and methods from the constructor function’s prototype property. If you want to understand JavaScript better, you need to understand how JavaScript itself leverages the prototype object.

  2. When creating user-defined constructor functions, you can orchestrate inheritance the same way JavaScript native objects do. But first you have to grok how it works.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint