jax-js
    Preparing search index...

    Function select

    • Select values from a list of choices based on a list of conditions.

      At each position, the output takes the value of the choice corresponding to the first true condition. Where no condition is true, defaultValue is used. Conditions are converted to boolean arrays, and all entries must be mutually broadcast-compatible.

      Parameters

      • condlist: ArrayLike[]

        List of array-like conditions, converted to booleans.

      • choicelist: ArrayLike[]

        List of arrays to choose from, same length as condlist.

      • defaultValue: ArrayLike = 0

        Value used where every condition is false. Default 0.

      Returns Array