What are good JavaScript OOP resources? [closed]

2019-01-12 15:07发布

问题:

JavaScript is a lightweight and powerful language, but it's often misunderstood and hard to learn (especially about its object oriented programming).

What are the good materials (blogs, screencasts and books) to learn JavaScript OOP? The topics can be anything, but let's not include browsers, AJAX and libraries for now.

Also how did you learn the functional programming, closure, object, inheritance and design patterns in JavaScript? Personally I would like to see more code examples because some of the books I mentioned above keep the example minimal.

(EDIT: As this post is now community effort, please help maintain and develop the following list of resources!)

Books

  • JavaScript: The Good Parts by Douglas Crockfond, This is the book recommended by most of Javascripters on Stack overflow. I observed, People have advanced their skills in java script with this book. Visit his website: crockford.com for more information.
  • Object-Oriented JavaScript: Create scalable, reusable high-quality JavaScript applications and libraries by Stoyan Stefanov, goes through many OOP topics such as Objects, Prototype, Inheritance and some patterns.
  • Pro JavaScript Design Patterns, by Ross Harmess and Dustin Diaz, discuss application of famous design patterns in JavaScript.

Videos

  • "Advanced JavaScript" videos by Douglas Crockford. Many other interesting videos are available at Yahoo! Developer Network.
  • The Definitive Guide to Object-Oriented JavaScript by James Shore (July 2013).

On Stack Overflow

  • A Stack Overflow discussion on JavaScript closure
  • A Stack Overflow discussion on What exactly does “closure” refer to in JavaScript?
  • A Stack Overflow discussion on Prototypal vs Functional OOP in JavaScript

Others

  • Introduction to Object-Oriented JavaScript - Mozilla Dev
  • JavaScript Closures for Dummies
  • JavaScript Closures
  • JavaScript Closures 101
  • Private Members in JavaScript by Douglas Crockfond
  • Classical Inheritance in JavaScript by by Douglas Crockfond
  • Prototypal Inheritance in JavaScript by by Douglas Crockfond
  • JavaScript, time to grok closures
  • Mozilla developer network

回答1:

You can see great code examples of Javascript in mainstream libraries like jQuery. I've learned a lot just reading it's source code. There's nothing better than reading sources that are working in millions of websites and are concerned about best practices.



回答2:

In the same vein as The Good Parts, Douglas Crockford's website has many good articles on JavaScript and OOP, such as Prototypal Inheritance, Classical Inheritance in JavaScript, etc.



回答3:

In addition to the previous references to Crockford's work, I recommend you read this perspective on the contrast of Functional vs. Classical inheritance patterns in JS:

Inheritance Patterns in JavaScript by Michael Bolin



回答4:

The recent Crockford on JavaScript video talks are worth watching - Act III: Function the Ultimate covers OOP in JavaScript.



回答5:

I have found this blog post to be the most clear explanation of prototypes: https://javascriptweblog.wordpress.com/2010/06/07/understanding-javascript-prototypes/

I have written a blog series on object orientation in JavaScript. You can access it here: https://rahuldotout.wordpress.com/2011/06/13/javascript-a-different-beast-part-7-inheritance-without-classes/



回答6:

Most of the resources you can get surfing on the internet. You can see the links googling on google. With the oops javascript code, there is no need for the developers to rewrite the code instead they can create small blocks of code. I' m listing down the resources of which I'm aware of -

https://www.quora.com/What-are-some-good-resources-for-JavaScript-OOP

http://www.c-sharpcorner.com/topics/javascript-oop

https://addyosmani.com/resources/essentialjsdesignpatterns/book/