-
-
Save anton-gorbikov/9b611888d672003aec586e90818ffcfc to your computer and use it in GitHub Desktop.
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
(function() { | |
$('#clickMe').on('click', function() { | |
console.log('aaa'); | |
}); | |
// Memory leak; | |
var button = document.querySelector('#clickMe'); | |
button.parentNode.removeChild(button); | |
// No memory leak; | |
// $('#clickMe').remove(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment