What will be the output of the following JavaScript code? [code] var person = { name: “Rahul”, getName: function()

What will be the output of the following JavaScript code?
Code:
var person = 
{  
      name: “Rahul”,  
      getName: function() 
      {  
          nreturn this.name;  
      }  
} 
var unboundName = person.getName;  
var boundName = unboundName.bind(person);  
document.writeln(boundName());
A. runtime error;
B. compilation error
C. Rahul
D. undefined
 

Tìm kiếm

Back
Top