0

What is the difference between window.location and window.Location in Javascript. The first one is object but the second one is a function, I know the use of the first one, but what is the use of second one?

Am1n
  • 13
  • 4
  • 3
    `window.location instanceof Location` – Ry- Jun 28 '22 at 21:29
  • 1
    In other words, `window.Location` is a constructor function, and `window.location` is an object that was created by that constructor function – Nicholas Tower Jun 28 '22 at 21:33
  • everything defined in the global scope is implicitly a property of the window object. the function Location is the constructor function for the location property itself. – Psi Jun 28 '22 at 21:34
  • Even better (works in Edge at least): `window.location instanceof window.Location` – Heretic Monkey Jun 28 '22 at 21:36

0 Answers0