Basic JavaScript Question:
Download Job Interview Questions and Answers 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");
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 Question | Next Question |
What does break and continue statements do in JavaScript? | What's Prototypes for JavaScript? |