Thanks, really glad you liked it 😊
As for the first one:
When you are in global scope there is no difference between using var and not using any keyword to declare a variable.
But if you declare a variable without a keyword (var, let, or const) it becomes available globally no matter when you declare it. Let's look at some examples.
function exampleFunction() {
var baz = 10;
};
printSomething();
console.log(baz);
Will throw a ReferenceError because we want to console.log variable which was declared within the scope of function.
But if we won't use var keyword like here:
function exampleFunction() {
bar = 10;
};
exampleFunction();
console.log(bar);
It will print out 10 because bar is globally available.
Hope it helps. Also, you should use let instead of var, I mentioned var because it is still part of syntax but let or const are recommended.