It seems like we are allowed to declare variables inside of conditional statements with inferred globals:
if(xo = 30){
let iffy = true;
}
However, is there a way or are we allowed to declare a variable with an 'let' or 'var' inside of an conditional statement? It would be something like the following:
if(var xo = 30){
let iffy = true;
}
The above code throws an exception but it's showing what i'm trying to achieve. With for loops it does allow declaraton of variables with an 'let' and 'var' in it's conditional statement. Could we replicate this for an if loop?