Y

Yashika • 3.75K Points
Extraordinary

Q. Which one of the following options is the correct output for the given code of JavaScript?

Code:
var person =  
{  
      name: "James",  
getName:function()  
{  
nreturnthis.name;  
}  
}  
varunboundName=person.getName;  
varboundName=unboundName.bind(person);  
document.writeln(boundName());  
  • (A) James
  • (B) compilation error
  • (C) runtime error
  • (D) undefined
  • Correct Answer - Option(A)
  • Views: 118
  • Filed under category JavaScript

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics