1
JavaScriptAdvanced#performance#functions
preventDefault cancels the browser's default action (form submit, link navigation) but the event keeps travelling. stopPropagation stops the event reaching other elements but the default action still happens.
form.addEventListener('submit', e => {
e.preventDefault(); // stay on the page
save();
});