I sometimes see people doing this Function(\'alert(\"hi\")\') and sometimes they do new Function(\'alert(\"hi\")\')
Is there a difference b
Invoking the Function constructor as a function (without using new operator) has the same same effect as invoking it as constructor.
That means it is same to code if you do it:
var result1 = new Function('a', 'b', 'return a + b')
var result2 = Function('a', 'b', 'return a + b')
result1 and result2 are same.