function isInstanceOf(type, obj) {
    // Cross-frame instanceof check
    return Object.prototype.toString.call(obj) === '[object ' + type + ']'
  }
Cross-frame instanceof check.

@param {string} type Instance type
@param {object} obj Object instance
@returns {boolean} Returns true if the object is of the given instance.