There is an interesting problem I solved today that I thought I might share. The basic idea can be solved by figuring out how to solve the following problem.
Consider this JavaScript
funcs = []
for(var i=0;i<10;i++)
funcs[i] = function() { alert(i); }
funcs[4]();
This will alert "10". Can you change it to alert "4"? The key to solving this problem is being able to create a function that stores i and then will evaluate the alert later.
Also
funcs[0] alerts "0"
funcs[1] alerts "1"
...
funcs[9] alerts "9"
Get the idea? Good luck!