I get something like this from api
[0, 1000], [1, 2000], [2, 1500]
where the first digit is the type and the second is the price.
And I iterated through the array like this:
const discountStud = discounts?.find((el) => el[0] === 1)?.filter((item) => item !== 1)
Is there a more elegant way? I write in React, and you can use lodash
P.S. I only need to get the price