Class: FarrThis

FarrThis

Arrays of functions with shared 'this' properties.


new FarrThis( [p])

constructor - create a FarrThis instance that can contain bound functions, where each function's this value is a plain object with some common parameters:

  1. a: the containing instance (FarrThis)
  2. i: the index of this element in the containing instance (integer)
  3. f: a reference to this element (function)
  4. o: any user-specified object, also accessible as the o property of the containing instance ('object')
Parameters:
Name Type Argument Default Description
p object | iterable | number <optional>
{ a: [], o: {} }

if a number, creates instance of that length. if an iterable, use its elements to generate new bound functions

Properties
Name Type Description
a iterable

iterable source for generating elements

o object

object to use for shared this binding

Source:

Members


o

o - an object shared by all bound function elements

Source: