Commit d433cf8c d433cf8ca19443b3cc0da33afd9ba73721f72603 by Nicolas Perriault

fixed sorting issue in googlematch sample

1 parent 324be9d1
......@@ -39,7 +39,7 @@ casper.each terms, (self, term) ->
self.echo "#{term}: #{score}"
casper.run ->
scores.sort -> (a, b) -> b.score > a.score
scores.sort -> (a, b) -> b.score - a.score;
winner = scores[0]
@echo "Winner is #{winner.term} with #{winner.score} results"
@exit()
......
......@@ -47,7 +47,7 @@ casper.each(terms, function(self, term, i) {
casper.run(function(self) {
scores.sort(function(a, b) {
return b.score > a.score;
return b.score - a.score;
});
var winner = scores[0];
self.echo('winner is "' + winner.term + '" with ' + winner.score + ' results');
......