Chrome throws a SyntaxError because you need () around your function, or you need to call it.
//This defines a as the function eval("function a(){alert('foo')}"); //This returns the anonymous function eval("(function(){alert('foo')})");
either should work correctly.
zellio
source share