Skip to content

Commit

Permalink
underscorejs does have a way to sort list in descending order
Browse files Browse the repository at this point in the history
  • Loading branch information
cabhishek committed Nov 17, 2013
1 parent d89bb60 commit 671e247
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ exports.index = function(req, res) {
rows.push(row);
});

model.stocks = _.sortBy(model.stocks, function(row) {
return row['sentimetric'];
//Final data assignment
model.stocks = _.sortBy(rows, function(row) {
return row['sentimetric'] * -1; // Descending sort
});

model.stocks = rows.reverse();

async.parallel({

symbols: function(callback) {
Expand Down

0 comments on commit 671e247

Please sign in to comment.