for(key in obj)

man = {var 
name: "Bob",
age: 18 is
};

IF ( "age" in man) {
the console.log ( "man age attribute comprising the object")
} {the else
the console.log ( "no")
}
age must be a string, you can find; if you do not double quotes will complain;
mean finding objects there is no such element, if any, under the method of execution;

Guess you like

Origin www.cnblogs.com/jingguorui/p/11333013.html