Understanding the four layers of JavaScript OOP

JavaScript OOP is baffling: on one hand, there is a simple core, on the other hand, there are some really weird things going on. I’ve been pondering for a long time how to explain it well and I think the best way to do so is via four layers: single objects, prototype chains, constructors, constructor inheritance. The first two layers are JavaScript’s simple OOP core, layers 3 and 4 are where the complications start.








The four layers of JavaScript OOP.


I’ve explained the four OOP layers in an O’Reilly webcast:



  • Video on YouTube (starts later to avoid duplicated content at the beginning)

  • Slides

  • Full webcast (requires Flash, but the audience’s comments in the chat are interesting)


Additional material:



Comments

Popular posts from this blog

Steve Lopez and the Importance of Newspapers

A Treasure Hunt Without The Treasure

Drop a ping-pong ball in the clown’s mouth