understanding waypoints code

understanding waypoints code

hey guys ! was just going through the code of waypoints.js and came across the following lines of code :: 


  1.   var Waypoint = window.Waypoint

  2.   function isWindow(element) {
  3.     return element === element.window
  4.   }

  5.   function getWindow(element) {
  6.     if (isWindow(element)) {
  7.       return element
  8.     }
  9.     return element.defaultView
  10.   }
and I have the following difficulties ::

what is element.defaultView doing ??? MDN , does't give much info and here , its mentioned , that it gives a referance to the window , what is its exact purpose in the code . 

also my other difficulty is , 

What is the below function doing ?? 

  1.  function isWindow(element) {
  2.     return element === element.window
  3.   }

I have no idea , is it checking if a given selected element is matching a element in window ? again , i am not sure . 

Understanding some code from waypoints.js