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

Object.freeze() #11

Open
zhangyanan0525 opened this issue Aug 10, 2018 · 0 comments
Open

Object.freeze() #11

zhangyanan0525 opened this issue Aug 10, 2018 · 0 comments

Comments

@zhangyanan0525
Copy link
Owner

zhangyanan0525 commented Aug 10, 2018

Object.freeze()

冻结指的是不能向这个对象添加新的属性,不能修改其已有属性的值,不能删除已有属性,以及不能修改该对象已有属性的可枚举性、可配置性、可写性。该方法返回被冻结的对象

资料来自

MDN文档Object.freeze()

语法

Object.freeze(obj)

重点

1.这个只能冻一层,里层对象冻不住。2.这个方法返回传递的对象,而不是创建一个被冻结的副本。

Object.isFrozen()

Object.isFrozen()方法判断一个对象是否被冻结。

@zhangyanan0525 zhangyanan0525 changed the title 冻结对象 Object.freeze() Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant