Object.prototype.hasOwnProperty()【プロパティ有無】メソッド
メモ
- 自身のプロパティの有無
構文
- hasOwnProperty ( V )
- V:プロパティ名
プロパティ有無 (true:あり / false:なし)
例
var point = { x:0, y:0 };
console.log(point.hasOwnProperty('x')); // true
console.log(point.hasOwnProperty('y')); // true
console.log(point.hasOwnProperty('z')); // false