actually asking if the property is there: Use for: checking the object itself has the property. if (foo.hasOwnProperty('a')) {. // do something. }.
確定! 回上一頁