diff options
author | Caolan McMahon <caolan.mcmahon@gmail.com> | 2014-04-28 15:35:29 +0100 |
---|---|---|
committer | Caolan McMahon <caolan.mcmahon@gmail.com> | 2014-04-28 15:35:29 +0100 |
commit | 64d178ad60bfcaf8df3b4dabc521f05caccb39b3 (patch) | |
tree | 8f7eb660af6f2d100afc7eb9575871d1ea9ef6ad | |
parent | 931d15412c5081e35f96dee3cc7a98d8322e7b17 (diff) | |
parent | ffab0a86e4ec35e8117de541719536b2cd0bf598 (diff) | |
download | async-64d178ad60bfcaf8df3b4dabc521f05caccb39b3.tar.gz |
Merge pull request #511 from kevinsawicki/patch-1
Fence code block as js
-rw-r--r-- | README.md | 29 |
1 files changed, 15 insertions, 14 deletions
@@ -532,20 +532,21 @@ __Sort Order__ By modifying the callback parameter the sorting order can be influenced: - //ascending order - async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x); - }, function(err,result){ - //result callback - } ); - - //descending order - async.sortBy([1,9,3,5], function(x, callback){ - callback(err, x*-1); //<- x*-1 instead of x, turns the order around - }, function(err,result){ - //result callback - } ); - +```js +//ascending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(err, x); +}, function(err,result){ + //result callback +} ); + +//descending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(err, x*-1); //<- x*-1 instead of x, turns the order around +}, function(err,result){ + //result callback +} ); +``` --------------------------------------- |