I know in jQuery it is best practice to assign selectors to variables in order to prevent from traversing the DOM repeatedly.
Is this also the case in vanilla JS, or do the extra lines declaring the constants just take up space unnecessarily?
jQuery Version:
var elem = $('#elem');
Vanilla JS Equivalent
const elem = document.getElementById('elem');