Posted By

noah on 06/15/07


Tagged

wrapper loop iterator syntacticsugar


Versions (?)

for loop wrapper


 / Published in: JavaScript
 

  1. function f (list, func) {
  2. for (var i=0; i< list.length; i++) {
  3. func(list, i);
  4. }
  5. }
  6.  
  7. function g (list, i) {
  8. list[i] *=2;
  9.  
  10. }
  11.  
  12. var h = [1,2,3];
  13.  
  14. f(h, g);

Report this snippet  

You need to login to post a comment.