Object.isFrozen()【プロパティ凍結 判定】メソッド

メモ

構文

  • Object.isFrozen ( O )

  • O:オブジェクト

  • 凍結 判定 (true:凍結 / false:その他)
  • true:入力のOがオブジェクト以外

TypeError 例外:O がオブジェクト以外

var point = { x:0, y:0 };
console.log(Object.isFrozen(point));  // 出力:false
Object.freeze(point);
console.log(Object.isFrozen(point));  // 出力:true

関連