var casper = require('casper').create();
casper.start();
casper.then(function(){
for(var i=1;i<3;i++){
this.repeat(3,function(){
this.echo("loop iteration!");
});
this.echo("hello");
}
});
casper.run()
Output:
hello hello loop iteration! loop iteration! loop iteration! loop iteration! loop iteration! loop iteration!
Why does "hello" print first?
How to write loop as synchronize loop?