How does the Function constructor work in JavaScript?
HTML:
JS:
function exec()
{
var code=document.getElementById('ta').value;
var fn=new Function(code);
fn();
}
Can anyone tell me the logic behind the code on how it display's "Hello World" and i was looking at the MDN
Does this code above creates a new alert function for me using the new Function constructor?