I had an interesting interview question today that stumped me a little. I was asked about falsey values. So undefined, NAn, Null, 0, an empty string all evaluate to false. What is the reason this is useful to know in javaScript? The only thing I can think of is instead of having to do this:
if(mystring === '' || mystring === undefined) { }
I can do this:
if(!mystring)
Is this the only useful application?