判断一个对象中是否有指定属性

判断一个对象中是否有指定属性

1 hasOwnPropertyhtml

var a  = {b:1}
a.hasOwnProperty('b')
true
a.hasOwnProperty('c')
false

  2 inpost

 

原连接: https://www.cnblogs.com/guozongzhang/p/10823806.htmlhtm

相关文章
相关标签/搜索