I saw below test question the other day in which the authors used a flowchart to represent the logic of loops, and I got to thinking it would be interesting to do this with some more complex logic. For example, the closure in this immediately-invoked function expression (IIFE) sort of boggles me:while (i <= qty_of_gets) {    // needs an IIFE    (function(i) {        promise = promise.then(function(){            return $.get(queries/html/ + product_id + i + .php);        });    }(i++));                       }I wonder if seeing a flowchart representation of what happens in it could be more elucidating. Could such a thing be done? Would it be helpful, or just messy? I haven't the foggiest clue where to start, but thought maybe someone would like to take a stab. Probably all the ajax could go and it could just be a simple return within the IIFE.
Make a flowchart to demonstrate closure behavior
javascript;programming practices;closures;flowchart