mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2025-05-26 03:32:20 +00:00
Update object.md
const descriptor = Object.getOwnPropertyDescriptor(o, 'foo'); ==> const descriptor = Object.getOwnPropertyDescriptor(obj, 'foo');
This commit is contained in:
parent
e81d6714d6
commit
20a5e6b182
@ -266,7 +266,7 @@ const obj = {
|
||||
obj.foo.name
|
||||
// TypeError: Cannot read property 'name' of undefined
|
||||
|
||||
const descriptor = Object.getOwnPropertyDescriptor(o, 'foo');
|
||||
const descriptor = Object.getOwnPropertyDescriptor(obj, 'foo');
|
||||
|
||||
descriptor.get.name // "get foo"
|
||||
descriptor.set.name // "set foo"
|
||||
|
Loading…
x
Reference in New Issue
Block a user