Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function foo1(d) {
- foo2(d++);
- console.log("Called on last index " + d);
- }
- function foo2(d, cb) {
- console.log("This is foo2", d);
- (function() {
- if (typeof cb == "function") {
- cb();
- return;
- }
- foo1(d);
- })();
- }
- foo1(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement