I am trying to access a outer variable inside a function within a function, but it is showing the variable as undefined in my debugger:
export class TestClass {
someObj = [ { id=1 }];
changeData() {
const someId = 1;
const test = {
attr: function() { return (this.somObj.find(x => x.id === someId )); }
};
}
}
this.someObj is undefined. Is it possible to accomplish this?