Bla*_*mba 7 javascript ecmascript-6
这是我的代码:
'use strict';
let obj = {
username : 'Hans Gruber',
hello: () => 'hello, ' + this.username
};
console.log(obj.hello());
Run Code Online (Sandbox Code Playgroud)
但输出是:hello, undefined
.
我希望输出是:hello, Hans Gruber
.
我想我还没有理解this
箭头功能?谁能给我一个明确的解释?