Skip to content
Chaoszhu'Blog
Search
K
Main Navigation
algorithm
front-end
back-end
api-analysis
interview
links
Appearance
Menu
Return to top
On this page
in操作符与Object.hasOwnProperty区别
区别如下
in操作符只要通过对象能访问到属性就返回true(沿着原型链找)
hasOwnProperty()只在实例中自身中存在时才返回true