DEVFYI - Developer Resource - FYI

How to create a function using function constructor?

JavaScript Interview Questions and Answers


(Continued from previous question...)

110. How to create a function using function constructor?

The following example illustrates this
It creates a function called square with argument x and returns x multiplied by itself.
var square = new Function ("x","return x*x");

(Continued on next question...)

Other Interview Questions