[removed] Is a member defined?

后端 未结 6 1991
自闭症患者
自闭症患者 2021-02-12 13:38

It seems to me that there are four different ways I can determine whether a given object (e.g. foo) has a given property (e.g. bar) defined:

6条回答
  •  南旧
    南旧 (楼主)
    2021-02-12 14:32

    one difference is that, method 1 will check only foo object for property bar while the last two methods will also check the prototype for inherited property.

提交回复
热议问题