demonstrate how normal actions can be performed within an `unload` event listener except for breakpoints
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.addEventListener('unload', (e) => { | |
console.log('unloading!'); // would successfully log to console | |
localStorage.setItem('key', 'value'); // would successfully set new item to local storage | |
debugger; // would fail to break at this point! | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment