From b6408da24722c021e7529c8a8314b32991d445bd Mon Sep 17 00:00:00 2001 From: Justin Noel Date: Mon, 28 Oct 2013 13:50:12 -0500 Subject: Changed the order of the asyn.each examples. The simpler version is first. The more detailed version is second. Signed-off-by: Justin Noel --- README.md | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ae34987..3fd505e 100644 --- a/README.md +++ b/README.md @@ -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 -}); -``` - ---------------------------------------- - ### eachSeries(arr, iterator, callback) -- cgit v1.2.1