31 lines
540 B
Plaintext
31 lines
540 B
Plaintext
|
|
||
|
{{alias}}( obj, prop, setter )
|
||
|
Defines a configurable write-only accessor.
|
||
|
|
||
|
Configurable write-only accessors are enumerable.
|
||
|
|
||
|
Parameters
|
||
|
----------
|
||
|
obj: Object
|
||
|
Object on which to define the property.
|
||
|
|
||
|
prop: string|symbol
|
||
|
Property name.
|
||
|
|
||
|
setter: Function
|
||
|
Set accessor.
|
||
|
|
||
|
Examples
|
||
|
--------
|
||
|
> var obj = {};
|
||
|
> var val = '';
|
||
|
> function setter( v ) { val = v; };
|
||
|
> {{alias}}( obj, 'foo', setter );
|
||
|
> obj.foo = 'bar';
|
||
|
> val
|
||
|
'bar'
|
||
|
|
||
|
See Also
|
||
|
--------
|
||
|
|