Skip to content

Instantly share code, notes, and snippets.

@wactbprot
Created August 14, 2014 12:49
Show Gist options
  • Save wactbprot/dc64f872945b714d245d to your computer and use it in GitHub Desktop.
Save wactbprot/dc64f872945b714d245d to your computer and use it in GitHub Desktop.
min assert test
var assert = require("assert");
var db_op = function(cb){
setTimeout(function(){
cb();
}, 1000)
};
var c = function(cb){
for(var i = 0; i < 10; i++){
db_op(function(j){
return function(){
cb(j);
}
}(i))
}
};
c(function(x){
console.log(x)
assert.equal(x, x);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment