const fun = () => console.log(variable);
let variable;
variable = 'some string';
fun();
Hello, guys I,m interested how JS works in this situation. In the function declaration I'm logging variable that is not declared yet. Output is 'some string'. So I'm interested is it because undeclared, but assigned variables become global variables?