Here is a code snippet that I have
for(var i=0; i < this.arr2.length; i++) {
arr.push({
id: i.toString(),
label: this.arr2[i],
display: () => this.arr2[i]
})
}
I'm curious why the display is undefined when using the following approach:
let val = this.arr2[i];
display: () => val
This method seems to be functioning correctly.