Live data from Hacker News

JavaScript Interview Question

cam.ly

1–10 of 63 posts

Re: JavaScript Interview Question

#3
A while back a couple of colleagues sat down and came up with our own set of JS interview questions. Here's what we came up with:

Can the interviewee code: https://gist.github.com/633341

Can the interviewee read/debug code: https://gist.github.com/633087

I used these questions during a couple of interviews. They seemed to work well.

Re: JavaScript Interview Question

#10

I think they all alert '3' because of the missing 'var' keyword.

This is my thought also, but I'm unsure of how to lock in the correct integer value to the alert, such that clicking each li element pops up the correct number.

I'm guessing one would have to create an object with a scope that holds the right value, on each turn through the loop.

Post reply on HN