declared with one of the keywords var, let, const, it becomes a global variable... could this be the reason?
I guessing is global since it's not defined into a function, class, block, etc ... they are just declared in the top execution context (main)
Yes. Use strict mode to make this an error so you don't accidently create globals https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
Обсуждают сегодня