How do I pass a function as a parameter without the function executing in the \"parent\" function or using eval()? (Since I\'ve read that it\'s insecure.)
eval()
Here it's another approach :
function a(first,second) { return (second)(first); } a('Hello',function(e){alert(e+ ' world!');}); //=> Hello world