understanding waypoints code
hey guys ! was just going through the code of waypoints.js and came across the following lines of code ::
- var Waypoint = window.Waypoint
-
- function isWindow(element) {
- return element === element.window
- }
-
- function getWindow(element) {
- if (isWindow(element)) {
- return element
- }
- return element.defaultView
- }
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 ??
- function isWindow(element) {
- return element === element.window
- }
?
I have no idea , is it checking if a given selected element is matching a element in window ? again , i am not sure .