Object vs Class vs Function

后端 未结 7 1041
南方客
南方客 2020-11-28 20:03

I was wondering - what\'s the difference between JavaScript objects, classes and functions? Am I right in thinking that classes and functions are types of objects?

A

7条回答
  •  余生分开走
    2020-11-28 20:25

    There are no classes in javascript. But, there are ways to make a function to behave like a class in other languages.

    A very good explanation is given here 3 way to define a class in js

    Also, found a very good reference for OOP in Javascript

提交回复
热议问题