Skip to content
New issue

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

delete 操作 #70

Open
Huauauaa opened this issue Mar 7, 2023 · 0 comments
Open

delete 操作 #70

Huauauaa opened this issue Mar 7, 2023 · 0 comments
Labels

Comments

@Huauauaa
Copy link
Owner

Huauauaa commented Mar 7, 2023

  • 任何使用 var 声明的属性不能从全局作用域或函数的作用域中删除。

  • 这样的话,delete操作不能删除任何在全局作用域中的函数(无论这个函数是来自于函数声明或函数表达式)

  • 除了在全局作用域中的函数不能被删除,在对象(object)中的函数是能够用delete操作删除的。

  • 任何用let或const声明的属性不能够从它被声明的作用域中删除。

不可设置的(Non-configurable)属性不能被移除。这意味着像Math, Array, Object内置对象的属性以及使用Object.defineProperty()方法设置为不可设置的属性不能被删除。

@Huauauaa Huauauaa added the js label Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant