Hi, today I've read we have a way of declaring the function by Function constructor. But I never seen the actual implementation that uses Function
constructor in real. So I would like to ask, are there any circumstances that we can get benefit by using Function
constructor as opposed to using function()
declaration? And what are the hidden differences of between?(if there is any)
Function Constructor
var func = new Function("x", "y", "return x*y;"); // pass the context by String
function():
var func = function(x, y){ return x*y; }
Thanks