Basic JavaScript Question:
Download Questions PDF

How to create a function using function constructor?

Answer:

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");

Download JavaScript Interview Questions And Answers PDF

Previous QuestionNext Question
What does break and continue statements do in JavaScript? What's Prototypes for JavaScript?