The only thing that is necessary is that our variables are locally scoped. We can use,
var for this purpose. Which we use is inconsequential.
const prevents variables from being reassigned. If they are primitive values, like a number or string, etc. Their values are fixed and cannot be altered. If they are an array or object then the data type is fixed but we can still manipulate the values and items.
navDropdown is (or rather should be) assigned a jQuery object.
const $navDropdown = $('#nav-dropdown');
There is no chance that this will be changed during the session since it is a cached element node which will not change. Mind, dynamically more child nodes could be added by the program, but that won’t change the identity of the cached node itself.
const just prevents our program from reassigning the variable a new node.