diff options
author | Justin Noel <github@calendee.com> | 2013-10-28 13:50:12 -0500 |
---|---|---|
committer | Justin Noel <github@calendee.com> | 2013-10-28 13:50:12 -0500 |
commit | b6408da24722c021e7529c8a8314b32991d445bd (patch) | |
tree | 27317ebca3a269fdacde69e68b27cafac5605ee4 | |
parent | f253cef6fcf8ff679b79639358b1650944603db2 (diff) | |
download | async-b6408da24722c021e7529c8a8314b32991d445bd.tar.gz |
Changed the order of the asyn.each examples. The simpler version is first. The more detailed version is second.
Signed-off-by: Justin Noel <github@calendee.com>
-rw-r--r-- | README.md | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -170,6 +170,16 @@ __Arguments__ __Examples__ + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + ```js // assuming openFiles is an array of file names and saveFile is a function // to save the modified contents of that file: @@ -203,17 +213,6 @@ async.each(openFiles, function( file, callback) { --------------------------------------- -```js -// assuming openFiles is an array of file names and saveFile is a function -// to save the modified contents of that file: - -async.each(openFiles, saveFile, function(err){ - // if any of the saves produced an error, err would equal that error -}); -``` - ---------------------------------------- - <a name="forEachSeries" /> <a name="eachSeries" /> ### eachSeries(arr, iterator, callback) |