-
Notifications
You must be signed in to change notification settings - Fork 1
Noboru Okazaki edited this page Aug 5, 2017
·
3 revisions
de is juicy object
- de.al(setPrototypeOf, PropertyDescriptors)
Object.create shorthand - de.fine(Any, PropertyDescriptors)
Object.defineProperties shorthand - de.tail(Any)
Object.getOwnPropertyDescriptors shorthand
- de.configurable(Object) and de._(Object)
return Allow configurable Descriptor was assigned Object - de.enumerable(Object)
return Allow configurable and enumerable Descriptor was assigned Object - de.writable(Object)
return Allow configurable and writable Descriptor was assigned Object - de.all(Object) return Allow all Descriptor was assigned Object
//example
de.fine({}, {
foo: de.writable({
value: 0
}),
bar: de._({
get () {
this.foo + 5;
}
set (v) {
this.foo = v + 10;
return true;
}
})
})