let fruits = [mango,banana,avocado,apple,orange,lychee];
let prices = [50,90,65,300,600,900]; // not constant value;
//Solution with If else
if(prices > 0 && prices <= 50) console.log("Mango@0-50")
if(prices > 51 && prices <= 65)console.log("Mango@0-50<br>Banana@51-65")
//So on
Is there any way to short it with loop?
This is how the result should look like
Mango@0-50
Banana@51-65
avocado@65-90
apple@91-300
orange@301-600
lychee@601-900
rest@>901
Note: I do not want to use If else;