lookup(search, ...values)

Seach is evaluated to a number which is used as zero-based offset to values array, returning the value at evaluated offset.

If index goes out of bounds, first value is used as fallback.

Usage:

  • For bounding lookups, use min(), max() and clamp() functions as appropriate.
  • You may add +1 to your formula to use the first value as explicit error fallback.

Example

lookup(2, 0, 10, 20, 30) // => 20
lookup(500, -100, 10, 20) // => -100

Hierarchy

Constructors

Properties

isIntermediate: boolean = false
result: null
search: any
terms: any

Function parameters

SERIALIZE_ATTRIBUTES: string[] = ...

Accessors

Methods

  • Parameters

    • __namedParameters: {
          maximize: undefined | boolean;
          minimize: undefined | boolean;
      } = {}
      • maximize: undefined | boolean
      • minimize: undefined | boolean

    Returns Promise<LookupTerm>

Generated using TypeDoc