Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's one of the worst interview questions I have ever heard.


Thank you for your opinion - it's proven reliable over the last decade.


If its just the one question then sure i agree... but if it was used as a kind of fun icebreaker question, then I can kind of see where it could be used.

But it's just very much asking around https://javascriptwtf.com/ level stuff


Can't agree here.

Especially when you deal with unsanitized data - like from a 3rd party API - you're bound to eventually have each of those cases find their way into your if statements/expressions.

Also, this question works for other languages too, as e.g. NaN can evaluate to True (Python) or have an undefined behaviour but still evaluate to true (C, C++) - it's useful to know what is true and what is false(y) in your language of choice, especially coming from another language.


Since I didnt think such word even exists I googled and apparently there is something called "falsy" in javascript.

To make it worse, there is a "truthy" too.

I guess a technical question. But my eyes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: