code: function defer(cb) {
      if (!defer.nextLoop) {
          var ntv = typeof setImmediate === 'function';
          defer.nextLoop = ntv ? setImmediate : function setImmediateShim(cb) {
              if (defer.obj) {
                  if (!defer.cbs.length) {
                      defer.obj.setAttribute('cnt', 'inc');
                  }
                  defer.cbs.push(cb);
              } else {
                  setTimeout(cb, 0);
              }
          };
          if (!ntv && typeof MutationObserver === 'object' && typeof document === 'object') {
              defer.cbs = [];
              defer.obj = document.createElement('div');
              defer.ob = new MutationObserver(function mutations() {
                  for (var cbl = defer.cbs.slice(), i = defer.cbs.length = 0, l = cbl.length; i < l; i++) {
                      cbl[i]();
                  }
              }).observe(defer.obj, { attributes: true });
          }
      }
      return defer.nextLoop.call(null, cb);
  }
docs: Defers a function's execution to the next iteration in the event loop
  
  @arg {function} cb the callback function
  @returns {Object} the callback's return value