Js determines whether a number is within an interval or whether it is equal to it.

var a = [0var 16, 24, 88, 99]; < var b = 77;
I want to look for b according to the value of b, b is in the subscript of a, or equal to that subscript!
b is 77, so its subscript corresponds to 60 is 3! If b is 88, then its subscript is the subscript of 88

Mar.22,2021

const findIndex = (val, arr) => (arr.findIndex((el) => el > val) - 1)
Menu