Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
preventExtensions()メソッドが拡張可能オブジェクトの拡張を妨げていますが、やり直す方法はありませんか? または、拡張不可能なオブジェクトを拡張可能なオブジェクトに変換する方法やトリックはありませんか。それが可能か不可能か知りたかったのです。
preventExtensions()
いいえ。プロトタイプは変更できますが、オブジェクト自体は変更できません。
MDN @ https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/preventExtensionsから:
拡張可能なオブジェクトを拡張不可能なオブジェクトに変換する方法がある場合、ECMAScript 5 ではその逆を行う方法はありません