1
0
mirror of https://github.com/ruanyf/es6tutorial.git synced 2025-05-24 18:32:22 +00:00

Update reflect.md

This commit is contained in:
lulin 2017-08-08 10:40:41 +08:00 committed by GitHub
parent 2eeb5a1edc
commit 3715691aec

View File

@ -451,11 +451,11 @@ Object.getOwnPropertyNames(myObject)
// ['foo', 'bar']
Object.getOwnPropertySymbols(myObject)
//[Symbol.for('baz'), Symbol.for('bing')]
//[Symbol(baz), Symbol(bing)]
// 新写法
Reflect.ownKeys(myObject)
// ['foo', 'bar', Symbol.for('baz'), Symbol.for('bing')]
// ['foo', 'bar', Symbol(baz), Symbol(bing)]
```
## 实例:使用 Proxy 实现观察者模式