obj(判断对象中是否包含某个key属性)

!("key" in obj)    //不包含

obj.hasOwnProperty("key")   //包含

猜你喜欢

转载自blog.csdn.net/qq_39237755/article/details/80838891