Now let me pass the challenge along to YOU before reading further. Attempt to answer all 21 questions in an hour. I didn’t have any trouble getting through them in that time span.
Once you’ve completed them and gathered your own thoughts, check out what I have to think about on each question below (and for the record, the team as a whole came to this same general consensus):
Question 2: What will be the output of the code below?
I like what this question is asking, I just don’t like the way it’s asking it. I definitely knew the concept of closure (a function withint a fuction that has access to the parent function scope) but didn’t know it knew the term “closure”. Maybe others do? I feel like asking about functions inside functions and scope would be better than just saying “what is closure?”
This is good. The answer is very simple and shows a good understanding of a function being able to return a function
Question 7: How do you check if an object is an array or not?
Another good question, and not just checking if an object is array – checking the type of ANY object (checking if an object is a function is a really good one that is done pretty regularly, for example)
Question 8: What will be the output of the following code?
Question 9: What will be the output of the following code?
This is pretty much the same as question 8? If you know what the delete keyword does from question 8, you know what it’ll do here…seems redundant. I guess this is just testing if the user knows how delete will affect different types of variables?
Question 10: What will be the output of the code below?
Question 11: What will be the output of the code below?
Ok this one tripped me up, I didn’t know that the delete keyword wouldn’t remove a prototype property on an object. So it’s a good question I guess? I wouldn’t put a ton of stock in it, though – of all the delete keyword questions (8,9,10 and 11), I think 10 was the best question, but again, I think a better question would be “what does ‘delete’ do?” or “how would you remove a property from an object?”
Question 13: What will be the output of the code below?
This is good question but I don’t like the way this test presented it. It’s really just asking “if you ‘delete’ a value from an array, does the array shrink?”
Question 14: What will be the output of the code below?
Question 15: What will be the output of the code below?
Question 16: What will be the output of the code below?
I feel this is a middle-of-the-road question. I see this basically testing if the user knows that bar() wouldn’t be defined outside of being assigned to foo, which displays a good understanding of the way function assignment to variables work, but isn’t really real-world (for example, I’ve never assigned a function with a name to a variable – I don’t really see a reason to do that, since you can’t use the function’s name to invoke the function outside of the function itself; you have to use the variable)
Question 17: What is the difference between the function declarations below?
Another really good question. This displays knowledge of run-time vs parse-time evaluation.
Question 19: What will be the output of code below?