|
|
|
|
|
by monsieurbanana
2719 days ago
|
|
What's the question? I like to ask them to explain either the concept of closures in javascript, or how `this` works. I don't even need them to know the word closure, knowing why you can't reference a variable written inside another function, the difference between var and let, or what does bind/apply do. |
|
false, null, undefined, NaN, "" (empty string), 0
Bonus: An object with a toString() method that returns one of the above won't evaluate directly, but will roughly equal (foo == false).
sometimes I'll ask for a function that returns input as a whole number or null, if it's a string, attempt to parse base 10, return null if invalid, return null if the input isn't already a number or a string. 0 is usually what will trip people up.