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