src/index.js
function getWindowForElement(element) {
  const e = element.documentElement || element;
  const doc = e.ownerDocument;
  return doc.defaultView;
}
function getWindowForElement(element) {
  const e = element.documentElement || element;
  const doc = e.ownerDocument;
  return doc.defaultView;
}
function getWindowForElement ( element ) { const e = element . documentElement || element ; const doc = e . ownerDocument ; return doc . defaultView ; }
Gets the window object from a given element or document

@private
@param {!HTMLDocument|HTMLElement} element The element to get the window object for
@return {Window|null} the window object for the given element
Gets the window object from a given element or document