IS OOP possible in Javascript?

2020-03-16 07:30发布

I recently found out that Javascript function can have classes, so I was wondering if OOP is also possible through javascript. Is It? If yes, Could you please point out some tutorials or site, where I can start with?

标签: javascript
7条回答
2楼-- · 2020-03-16 08:35

OOP is central to Javascript, but it's not classical OOP. Javascript uses prototypes, not classes.

Douglas Crockford is a Javascript genius, so his Prototypal Inheritance in Javascript is a nice starting point. A Google search for "Javascript OOP" likely will turn up some neat articles to peruse, as well — I like the article by Mike Koss.

查看更多
登录 后发表回答