We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const obj = { a: 1, b: 2 } Object.preventExtensions(obj); obj.a = 2; // 可修改 delete obj.b; // 可删除 obj.c = 3; // 不可拓展 console.log(obj);
freeze:不可修改、不可删除、不可拓展 seal:可修改、不可删除、不可拓展 preventExtensions:可修改、可删除、不可拓展
freeze
seal
preventExtensions
The text was updated successfully, but these errors were encountered:
No branches or pull requests
preventExtensions、freeze、seal区别
freeze
:不可修改、不可删除、不可拓展seal
:可修改、不可删除、不可拓展preventExtensions
:可修改、可删除、不可拓展The text was updated successfully, but these errors were encountered: