Struggling to organize a large array of 2000 elements in ReactJS using JavaScript. The array includes:
data = [
{
index: 0,
id: "404449",
product_name: "ette",
brand_name: "Dyrberg/Kern",
base_price: "55.000",
actual_price: "55.000",
filename:
"http://images.booztx.com/dyrbergkern/400x523/329679_ette_sg_crystal.jpg",
},
{
index: 1,
id: "414661",
product_name: "braided mobile chain",
brand_name: "Octopus",
base_price: "44.900",
actual_price: "44.900",
filename: "http://images.booztx.com/octopus/400x523/SC09-750MU.jpg",
},
]
My attempt at sorting by base_price using Array.sort( ) is taking too long due to the size of the array. It currently takes about 4 minutes to sort all 2000 elements. Any suggestions on how to speed up this process?