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
πŸ’¬ Discuss
βœ… Correct Answer: (A) James

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
258
Total Visits
πŸ“½οΈ
5 y ago
Published
πŸŽ–οΈ
Yashika
Publisher
πŸ“ˆ
98%
Success Rate