Documentation
    Preparing search index...

    Function createArrayElementBinding

    • Resolves path against target and binds element index of the array it names — the explicit spelling of the indexed-array binding form (§16, §17; RFC 0003 §2), equivalent to createBinding(target, path + "." + index, numberAdapter).

      const weight = createArrayElementBinding(morphWeights, "weights", 0);
      weight.set(0.5); // writes weights.weights[0]

      The element must exist when the binding is created (§16: resolved once) — an index at or past the array's length is refused loudly here rather than silently growing a plain array or dropping writes into a typed one. The value kind is number: §17's morph-weight track is a scalar track, and an element of any numeric array binds through numberAdapter.

      Parameters

      • target: object

        Root object of the path.

      • path: string

        Dot-separated path to the array; must be non-empty.

      • index: number

        Element index; a non-negative integer inside the array.

      Returns PropertyBinding

      FourError INVALID_APPLICATION_STATE — the path does not resolve, or index is not a non-negative integer inside the named array.