1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-28 21:32:20 +00:00

Update reflect.md

This commit is contained in:
bigbird231 2019-05-08 12:40:17 +08:00 committed by GitHub
parent 584ee0dc47
commit 7bad01cae6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -511,6 +511,8 @@ Reflect.ownKeys(myObject)
// ['foo', 'bar', Symbol(baz), Symbol(bing)]
```
如果第一个参数不是对象,`Reflect.ownKeys`方法会报错。
## 实例:使用 Proxy 实现观察者模式
观察者模式Observer mode指的是函数自动观察数据对象一旦对象有变化函数就会自动执行。