I'm wondering what the arguments are for using one vs the other. I am familiar with the other properties like window.location.pathname
. But as far as I can tell, assigning to window.location
has identical behavior to calling window.location.assign
and passing it the url.
Why use one or the other? I prefer assign
because it's more explicit whereas assigning to window.location
has implicit, veiled magic in its setter.
Is there an argument for one or the other?