You can create functions on the fly in Javascript through the new Function constructor (as an alternative to eval()). Are there any performance issues with that? Find out!
Comparing performance of: Real function vs Dynamic function vs Evaluated function