fork download
  1. // your code goes here
  2. var sockets=[{},{},{}];
  3. for(var i=0;i<3;i++){
  4. sockets[i].debug=(function(id){
  5. return function(){
  6. print(id);
  7. }
  8. })(i);
  9. }
  10.  
  11. for(i=0;i<3;i++){
  12. sockets[i].debug();
  13. }
Success #stdin #stdout 0.02s 4940KB
stdin
Standard input is empty
stdout
0
1
2