The value thiswill not work like this, it refers to the value determined by the context of the actual execution, and not to your object literal.
If you declare, for example, a member of a function of your object, you can get the desired result:
var closure = {
myPic: document.getElementById('pic1'),
getPicArray: function () {
return [this.myPic];
}
};
closure.getPicArray();
this, getPicArray, closure.
, this.
: , , , getPicArray Array , - , :
var closure = {
myPic: document.getElementById('pic1')
};
closure.picArray = [closure.myPic];
closure.picArray.