[JavaScript] `in` 关键字

The operator in can be used to test whether an object has a certain property.

 

var person  = {}
person.name = "buhaiqing"
console.debug( "name" in person) // return : true

 

posted @ 2012-12-04 11:25  卜海清  阅读(219)  评论(0)    收藏  举报