I have a function which returns several callbacks, each with a different value based on the given states thought the function, something like:
function dothis(callback) {
for (var x = 1; x < 10; x++) {
if (x % 2 == 0) {
callback(x + " is even");
}
}
}
dothis(function(res) {
console.log(res);
})
That will print out the following:
2 is even
4 is even
6 is even
8 is even
I wonder if that would affect performance somehow or if it might end up in memory leak or any other issue with node.js
Comments
Post a Comment