What will be the output of the following JavaScript code? [code] var pow=new Function("num1","num2","return Math.pow(num1,num2)");

Lò Ngọc

New member
What will be the output of the following JavaScript code?
Code:
     var pow=new Function("num1","num2","return Math.pow(num1,num2)");  
     document.writeln(pow(2,3));
A. 2
B. 3
C. 8
D. error
 
Answer: c
Explanation: pow function is a predefined function which is present in the math library of javascript. The pow function accepts two arguments of which power of the first argument is calculated with respect to the second.
 

Tìm kiếm

Back
Top