<Script>
"use strict";
let arr = ["a", "b"];
arr.push( function () {
alert(this);
})
//it pushes an object which is function at arr[2]
//but why does the function contains a and b? because of this?
//what "this" means? the whole array? is that why?
//oh maybe it should
arr[2]();
//but why line 17 shows even the contents of the function?
</Script>
"use strict";
let arr = ["a", "b"];
arr.push( function () {
alert(this);
})
//it pushes an object which is function at arr[2]
//but why does the function contains a and b? because of this?
//what "this" means? the whole array? is that why?
//oh maybe it should
arr[2]();
//but why line 17 shows even the contents of the function?
</Script>
댓글
댓글 쓰기