Describe the bug
"this" keyword is undefined in searchFn
To Reproduce
Steps to reproduce the behavior (if example is not provided):
Expected behavior
"this" should not be undefined in searchFn
Screenshots


Desktop (please complete the following information):
For anyone else landing here, here is the correct syntax:
searchFn = (term: string, item: any) => {
console.log(this);
return true;
}
for anyone else landing here, a decent example:
public searchFn(term: string, pigeon: Pigeon): boolean {
const ringNumber = pigeon.ringNumber.toLocaleLowerCase();
const name = pigeon.name.toLocaleLowerCase();
term = term.toLocaleLowerCase();
return ringNumber.indexOf(term) !== -1 || name.indexOf(term) !== -1;
}
Most helpful comment
For anyone else landing here, here is the correct syntax: