37 lines
721 B
Plaintext
37 lines
721 B
Plaintext
|
|
||
|
{{alias}}( obj, prop, getter, setter )
|
||
|
Defines a non-enumerable property having read-write accessors.
|
||
|
|
||
|
Non-enumerable read-write accessors are non-configurable.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
obj: Object
|
||
|
Object on which to define the property.
|
||
|
|
||
|
prop: string|symbol
|
||
|
Property name.
|
||
|
|
||
|
getter: Function
|
||
|
Get accessor.
|
||
|
|
||
|
setter: Function
|
||
|
Set accessor.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var obj = {};
|
||
|
> var name = 'bar';
|
||
|
> function getter() { return name + ' foo'; };
|
||
|
> function setter( v ) { name = v; };
|
||
|
> {{alias}}( obj, 'foo', getter, setter );
|
||
|
> obj.foo
|
||
|
'bar foo'
|
||
|
> obj.foo = 'beep';
|
||
|
> obj.foo
|
||
|
'beep foo'
|
||
|
|
||
|
See Also
|
||
|
--------
|
||
|
|