const benda = {
a: function() {
this.v_a = 1;
let x = {
count_va: () =>{ // notice here, we're using () => {...}
return this.v_a;
}
}
return x.count_va();
}
}
benda.a() // 1.
const benda = {
a: function() {
this.v_a = 1;
let x = {
count_va: function() { // notice here, we're using function() {...}
return this.v_a;
}
}
return x.count_va();
}
}
benda.a() // undefined.