When executing the following code on Chrome's console, it works as expected:
function printNameWithAdj(adjective) {
alert(this.name + " is " + adjective);
}
var name = "john";
printNameWithAdj.call(this, "nice");
and it prints "john is nice"
.
But when running it in JSFiddle, it gives "result is nice"
.
Where does result
come from, and what is the reason for the difference between the environments/engines?