判断对象中是否有此属性

 

obj.hasOwnProperty('par')    

par为属性  返回值为Boolean

 

posted @ 2021-10-18 14:10  web格调  阅读(27)  评论(0编辑  收藏  举报