JavaScript オブジェクトのプロパティ存在チェック

in演算子を使うと簡単。

var a = {dog:1,cat:2};

console.log('dog' in a);// true
console.log('human' in a);// false