flight.hasOwnProperty('number') // true
flight.hasOwnProperty('constructor') // false
//use
if (typeof flight["number"]) == "undefined")
{
}
Tuesday, April 14, 2009
do not use hasOwnProperty
The hasOwnProperty method does not look at the prototype chain:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment