Object.isExtensible()【拡張(プロパティ追加)可否】メソッド
メモ
- 拡張(プロパティ追加)可否
- 参照:プロパティの変更・追加・削除 防止
構文
- Object.isExtensible ( O )
- O:オブジェクト
- 拡張(プロパティ追加)可否 (true:拡張可 / false:拡張不可)
- false:入力のOがオブジェクト以外
TypeError 例外:O がオブジェクト以外
例
var point = { x:0, y:0 };
console.log(Object.isExtensible(point)); // true
Object.preventExtensions(point);
console.log(Object.isExtensible(point)); // false