var length = 10;
function fun() {
console.log(this);
console.log(this.length)
}
var obj = {
length: 5,
get(fun) {
fun();
arguments[0]()
}
}
obj.get(fun,2)
console.log('------------------------------------------')
var z = 10;
function fun1 () {
console.log(this);
console.log(this.z)
}
var obj1 = {
z: 5,
get: fun1
}
obj1.get()
console.log('------------------------------------------')
var aaa = 1;
var aa = function () {
console.log(this.aaa)
}
var obj2 = {
aaa: 2,
get: aa
}
var {get} = obj2;
obj2.get()
get()
console