What is meant by 'first class object'?

后端 未结 11 1571
生来不讨喜
生来不讨喜 2020-11-22 10:46

In a recent question, I received suggestions to talk on, amongst other things, the aspect of JavaScript where functions are \'first class\' objects. What does the \'first c

11条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 11:01

    It means that functions are objects, with a type and a behaviour. They can be dynamically built, passed around as any other object, and the fact that they can be called is part of their interface.

提交回复
热议问题