Advertisement
Guest User

Untitled

a guest
May 24th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. function foo1(d) {
  2. foo2(d++);
  3. console.log("Called on last index " + d);
  4. }
  5. function foo2(d, cb) {
  6. console.log("This is foo2", d);
  7. (function() {
  8. if (typeof cb == "function") {
  9. cb();
  10. return;
  11. }
  12. foo1(d);
  13. })();
  14. }
  15. foo1(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement