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

I usually start with, "In JavaScript what 6 values evaluate to false?" ... almost nobody gets it, but it's usually an excellent barometer for how well they know JS as a language and guides the rest of the questions.

Aside: I tend to prefer people who have worked with multiple languages that are different from each other, regardless of language. Also, way too many people look down on JS without actually knowing JS.



... well now I feel dumb, I guessed 5 ... except for false itself!


false, 0, null, undefined, "", NaN

Everything else is truthy. If you think about the original use of JS as mostly input validation, the values above make total sense.




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

Search: