var func =(arr,w,h) => arr[arr.findIndex(el=>el[0]>w)-1][arr[0].findIndex(el=>el>h)-1]; console.log(func(price1Arr,2000,3000));