Programming Languages JavaScript Objective
Mar 04, 2013

How to assign a function to a variable with the JavaScript Function contructor?

Choose the correct answer:
A) var f=Function("x","y","return x+y");
B) var f=Function(x,y){ return x+y;}
C) var f= new Function("x", "y", "return x + y");
D) var f= Function("x", "y", "return x + y");
Detailed Explanation

Option C is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback