Since i have not declared the variable anywhere , why am i getting a value for it rather than an error . I am directly assigning it a value and not declaring it first.
let x = [0 ,1]
if(x){
target = x[0]
}
console.log(target)
I was expecting an reference error but got value for target that was 0