News for hackers. Stuff that matters.
Re:Ask HN: Is web development still a viable career choice? by monsieurbanana on Tuesday January 08, 2019 @03:47PM (#18859515)
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.

Re:Ask HN: Is web development still a viable career choice? by tracker1 on Tuesday January 08, 2019 @04:54PM (#18860114)
What are the values that equate to false in an if statement?

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.

Re:Ask HN: Is web development still a viable career choice? by jtchang on Sunday January 13, 2019 @04:40PM (#18898886)
Doesn't an empty array also equal false?
Re:Ask HN: Is web development still a viable career choice? by jtchang on Tuesday January 08, 2019 @08:07PM (#18861414)
Isn't this basically atoi? Which has a lot of edge cases.
Re:Ask HN: Is web development still a viable career choice? by tracker1 on Tuesday January 08, 2019 @09:02PM (#18861682)
pretty much... the main one I tend to ask is the 6 falsy values, clarified as needed. The responses tend to be a good overall indicator of how well the person knows JS.
Re:Ask HN: Is web development still a viable career choice? by jtchang on Thursday January 10, 2019 @09:42PM (#18880592)
How does it indicate how well someone knows JS? That's the type of question you can easily Google.

Not to mention in general Javascript does some pretty not intuitive things with objects: https://archive.org/details/wat_destroyallsoftware

Re:Ask HN: Is web development still a viable career choice? by tracker1 on Sunday January 13, 2019 @03:44PM (#18898568)
Well, if someone googles it in a live interview, they're pretty much out. It's not the ONLY question I ask, but will guide where the rest of questions come from.

It's (knowledge of falsy values) been a very representative indicator of how well they know the language itself. It's not an indicator of understanding software as a whole, or a given UI framework or library.