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

fix: 修改错误的示例代码 #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions JS高级技巧/防篡改对象.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ECMAScript 5也增加了几个方法,通过它们可以指定对象的行为
testObj.age="2";
testObj.testKey="2";
delete testObj.name;
console.log(testObj.name,testObj.age,testObj.testKey);//2 undefined
console.log(testObj.name,testObj.age,testObj.testKey);//undefined 2 undefined

var obj1=testObj;

Expand Down Expand Up @@ -168,7 +168,7 @@ ECMAScript 5也增加了几个方法,通过它们可以指定对象的行为
按照有宽松到严格是排序是;

- **【增、删、改、查】 -- Object.preventExtension() --> 【-、删、改、查】 **
- **【增、删、改、查】 -- Object.seal() --> 【-、-、-、查】 **
- **【增、删、改、查】 -- Object.seal() --> 【-、-、、查】 **
- **【增、删、改、查】 -- Object.freeze() --> 【-、-、-、查】 **

对应的检测方法分别是:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
1. [Data类](./研究Data类/README.md)
1. [Global对象](./研究全局对象/README.md)
1. [RegExp类型](./正则表达式/README.md)
1. [定时器](./正则表达式/README.md)
1. [定时器](./动画与定时器的应用/README.md)

---

Expand Down
2 changes: 1 addition & 1 deletion 研究全局对象/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ eval()方法就像是一个完整的 ECMAScript 解析器,它只接受一个参
var testVar;
console.log(testVar);//undefined
console.log(msg);//Uncaught ReferenceError: msg is not defined
eval('var msg = "hello world eval"');
eval('var msg = "hello world"');
eval("console.log(msg)"); //"hello world"

> 严格模式下,在外部访问不到 eval() 中创建的任何变量或函数,因此前面两个例子都会导致错误。同样,在严格模式下,为 eval 赋值也会导致错误
Expand Down