time-to-botec/js/node_modules/@stdlib/utils/define-configurable-read-write-accessor/docs/repl.txt
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

37 lines
711 B
Plaintext

{{alias}}( obj, prop, getter, setter )
Defines a configurable property having read-write accessors.
Configurable read-write accessors are enumerable.
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
--------