time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (583B)


      1 
      2 {{alias}}( obj, prop, fcn )
      3     Defines a memoized read-only object property.
      4 
      5     Read-only properties are enumerable and non-configurable.
      6 
      7     Parameters
      8     ----------
      9     obj: Object
     10         Object on which to define the property.
     11 
     12     prop: string|symbol
     13         Property name.
     14 
     15     fcn: Function
     16         Synchronous function whose return value will be memoized and set as the
     17         property value.
     18 
     19     Examples
     20     --------
     21     > var obj = {};
     22     > function foo() { return 'bar'; };
     23     > {{alias}}( obj, 'foo', foo );
     24     > obj.foo
     25     'bar'
     26 
     27     See Also
     28     --------
     29