in JavaScript by
Which one of the given options can be considered as the correct output of the following code?

var addition=newFunction("number1","number2","return number1+number2");  


a) 12

b) 13

c) 15

d) Error

1 Answer

0 votes

Answer: C

Reason: The "addition()" function was defined in the first line of code using the "new" property. In the second line of code, the addition function is called along with two passed arguments as 10, 5 inside the "document.write()" method, which prints the sum of two passed arguments returned by the "addition()" method.

Related questions

+1 vote
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 24, 2021 in JavaScript by sharadyadav1986
0 votes
asked Mar 23, 2021 in JavaScript by sharadyadav1986