What is the key difference between window.location.assign() and history.pushState() for changing URLs?
The key difference is that assign() triggers a full page load while pushState() doesn't: 1) window.location.assign() performs traditional navigation, completely reloading the page from the new URL, 2) history.pushState() changes the URL in the address bar without reloading the page or making a server request, 3) assign() can navigate to any URL, including external domains, 4) pushState() is restricted to URLs within the same origin for security reasons, 5) assign() discards the current page's JavaScript context entirely, 6) pushState() maintains the current page context, requiring manual content updates, 7) assign() is appropriate when actually navigating to a different resource, 8) pushState() is ideal for client-side routing in single-page applications where only the content needs to change.