dynamically generate multiple functions javascript

JavaScript
var f = new Function('name', 'return alert("hello, " + name + "!");');
f('erick');
Source

Also in JavaScript: