I have read through call() method and wondering on the global output below. Shouldnt it be this.name where in this case "Michael". However the output displayed is undefined.
---NEW INFORMATION : THIS IS RUNNING THROUGH NODEJS---
function sayNameForAll(label) {
console.log(label + ":" + this.name);
}
var person1 = {
name: "Nicholas"
};
var person2 = {
name: "Greg"
};
var name = "Michael";
sayNameForAll.call(this,"global"); //ouput global:undefined
sayNameForAll.call(person1,"PersonName1"); //PersonName1:Nicholas
sayNameForAll.call(person2,"PersonName2"); //PersonName2:Greg