Skip to content

Commit e376974

Browse files
authored
Merge pull request ruanyf#671 from Tomotoes/patch-1
Update proxy.md
2 parents 2d86fc3 + 9708a21 commit e376974

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/proxy.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ Reflect.apply(proxy, null, [9, 10]) // 38
503503

504504
`has`方法用来拦截`HasProperty`操作,即判断对象是否具有某个属性时,这个方法会生效。典型的操作就是`in`运算符。
505505

506+
`has`方法可以接受两个参数,分别是目标对象、需查询的属性名。
507+
506508
下面的例子使用`has`方法隐藏某些属性,不被`in`运算符发现。
507509

508510
```javascript
@@ -579,7 +581,7 @@ for (let b in oproxy2) {
579581
// 99
580582
```
581583

582-
上面代码中,`has`拦截只对`in`运算符生效,对`for...in`循环不生效,导致不符合要求的属性没有被排除在`for...in`循环之外
584+
上面代码中,`has`拦截只对`in`运算符生效,对`for...in`循环不生效,导致不符合要求的属性没有被`for...in`循环所排除
583585

584586
### construct()
585587

@@ -596,7 +598,7 @@ var handler = {
596598
`construct`方法可以接受两个参数。
597599

598600
- `target`: 目标对象
599-
- `args`构建函数的参数对象
601+
- `args`构造函数的参数对象
600602

601603
下面是一个例子。
602604

0 commit comments

Comments
 (0)