inside es6 class constructor i call a function that returns successfully an array of two objects
But, when i try to access one of those objects i get undefined
here is the log ...
console.log(images) gives
Array [] 0: Object { _id: 118, index: 0, _batchingTransformChange: false, … } 1: Object { _id: 130, index: 0, _batchingTransformChange: false, … } length: 2 : Array []
And console.log(images[0])
images[0] undefined
constructor code
constructor(snapWidth, blockPositioning, config = {}) {
if (!Object.values(BlockPositioning).includes(blockPositioning)) {
throw 'Parameter blockPositioning is not supported!';
}
super(config)
this.#snapWidth = snapWidth
this.somevalue = 7
this.#blockPositioning = blockPositioning
let images = this.#addActionImages()
this.addActionImg = images[0]
this.removeActionImg = images[1]
console.log('images ', images)
console.log('images[0] ', images[0])
console.log('images[1] ', images[1])
console.log('this.addActionImg ', this.addActionImg)
console.log('this.removeActionImg ', this.removeActionImg)
}