ixfx
    Preparing search index...

    Function isCloseToAny

    • Yields a function that checks if a value is close to any target value

      const c = isCloseToAny(1, 10, 20, 30, 40);
      c(11); // True - within 1 range of 10
      c(19); // True - within 1 range of 20
      c(0); // False

      Returned function accepts multiple values, returning true if any of them are within range

      c(0, 1, 11); // Would return true based on 11
      

      Parameters

      • allowedRangeAbsolute: number
      • ...targets: number[]

      Returns (...values: number[]) => boolean