i am having an array of var calculation = []; that holds some object and each object has price associated with this. I need to find smallest price among that collection and need to remove that object form array collection. I am doing as following but no success how can i achive this?
while (chargedItems > 0) {
currCustomziationPrice = currCustomziationPrice + Math.min.apply(Math, calculation.price); // 1
chargedItems = chargedItems - 1;
calculation.splice($.inArray(itemtoRemove, arr), 1);
alert(currCustomziationPrice + "___" + chargedItems);
}
calculation.pricereturn something? It should becalculation[index].price