Have fun debugging that.

As Todd Blanchard likes to say, if you have to resort to eval, then your platform is not powerful enough. That might mean that your platform lacks the features that you really need, or that you don't know the features that it has.

See if he knows what closures are... (Yes, JavaScript supports them.)

Cheers,
Ben

PS I'll accept that the users likely asked for exactly what he produced. And that it was the wrong thing to ask for. But that is separate from the programming technique issue...