I have updated my Node.Js
into version 7.6.0
and running google chrome version 57.0
on the other hand.
When I run this snippet of javascript code, I get two different result like below:
'use strict'
var obj = {
id: "awesome",
cool: function coolFn() {
console.log(this.id);
}
};
var id = "not awesome";
obj.cool(); //awsome
setTimeout(obj.cool, 100);
result on chrome:
awesome
not awesome
result on node.js:
awesome
undefined
Recording to https://nodejs.org/en/docs/es6/ I even used the --harmony
flag but the result of node.js didn't change.