time-to-botec/js/node_modules/@stdlib/utils/define-configurable-read-only-accessor/docs/repl.txt

29 lines
501 B
Plaintext
Raw Normal View History

{{alias}}( obj, prop, getter )
Defines a configurable read-only accessor.
Configurable read-only accessors are enumerable.
Parameters
----------
obj: Object
Object on which to define the property.
prop: string|symbol
Property name.
getter: Function
Get accessor.
Examples
--------
> var obj = {};
> function getter() { return 'bar'; };
> {{alias}}( obj, 'foo', getter );
> obj.foo
'bar'
See Also
--------