This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)
Given the code
| if (!(Symbol.iterator in Object.prototype)) { | |
| Object.defineProperty(Object.prototype,Symbol.iterator,{ | |
| enumerable: false, | |
| writable: false, | |
| configurable: true, | |
| value: function() { | |
| var o = this; | |
| var idx = -1; | |
| var ks = Object.keys(o); | |
| return { |