I just saw a js question which is:
What's the result of:
if ([]) {console.log(1);}
if ([].length) {console.log(2);}
if ({} === {}) {console.log(3);}
if ('' == 0) {console.log(4);}
I tried with the console and it gave
1
4
Why [].length
gives false? Is the length undefined?