While facing an interview I got confused between
- if({}) console.log("hello")
- if([]) console.log("hello")
- if(' ') console.log("hello")
- if('') console.log("hello")
I know that first three will print hello , but I don't know on what basis evaluation is done.
And even I'll like to know about few sites or URL from where I can get these tricky questions and solutions