0

what is the difference if I put window.location.href instead of location.href both of them seems to be returning the same value

  • Better duplicate: http://stackoverflow.com/questions/19423513/is-there-any-difference-with-using-only-location-vs-using-window-location-across – JJJ Feb 15 '17 at 18:10
  • Related: http://stackoverflow.com/questions/4709037/window-location-versus-just-location?noredirect=1&lq=1; http://stackoverflow.com/q/6263073/2680216; http://stackoverflow.com/questions/19423513/is-there-any-difference-with-using-only-location-vs-using-window-location-across; http://stackoverflow.com/questions/9903659/difference-between-window-location-and-location-href – Josh Crozier Feb 15 '17 at 18:11
  • in Global context, all variables are assigned to window. So window.location===location . You may have a deeper look on *js global scope* + *js variable declaration* – Jonas Wilms Feb 15 '17 at 18:11
  • Depending on the scope, yes – Adam Azad Feb 15 '17 at 18:11

0 Answers0