Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

each

shimondoodkin edited this page · 1 revision

function each(shared,items,each_function [,callback] [,debug])

a for each function, it can have an object as input for items

each_function: (as in Array.forEach callback)

inflow.each(
shared,
items,
function (value,key,array){;this();},
callback 
[,debug]);

example:

app.inflow.each(shared,[
 {phone:'111111111234',name:'Simon'},
 {phone:'222222221234',name:'Avi'}
],function (val){
 shared.res.write(val.phone+" - "+val.name+"\r\n");
 this();
},function (){
 shared.res.end('done');
});

output:

111111111234 - Simon
222222221234 - Avi
done

/*
 It seems to me that the shared object in Each() and in While() is useless.
 tell me what you think.
*/
Something went wrong with that request. Please try again.