var hoisting
Been educating me self about modern Javascript. It has some werid shit like var hoisting. Pretty sure that’s a bug that somehow became a quote unquote feature, lol.
In Javascript you can legally define a function scoped variable anywhere in the function including in an if statement or after using a variable.