Added the Price Sorting.
This commit is contained in:
parent
d3b5d7c969
commit
bed0e13ceb
1 changed files with 4 additions and 1 deletions
|
@ -75,6 +75,9 @@ var products = [
|
|||
}
|
||||
];
|
||||
|
||||
products.sort(function(a, b) {
|
||||
return a.price - b.price;
|
||||
})
|
||||
|
||||
|
||||
// given restrictions provided, make a reduced list of products
|
||||
|
@ -122,5 +125,5 @@ function getItemPrice(chosenProduct){
|
|||
return products[i].price;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue