I do not know Python at all and I tried to google the question and here is what I’ve found:
Regarding the variable declaration in Chrome’s console. Actually, it’s a good question. I’ve also tried to google it and find out what is the actual reason. Here are my findings:
It’s considered bad practice because you’re actually declaring the variables in the global scope, instead of just within the function (or block). It spells trouble when you have the same variable name in different functions. They will all touch that same global variable instead of having their own
The console is useful for trying things out. If you had to use let/const you would need to refresh the console (by refreshing the current browser page) every time you wanted to try something using the same variable names, which is a pain. So you can just declare global variables (which would normally cause warnings in actual strict mode code). The Node REPL is exactly the same.