Typescript search in array

Date: 2022-10-24
export function searchInArray<T>(items: T[], descriptionFn: (t: T) => string, searchText: string): T[] {
    const words = searchText.toLowerCase().trim().split(" ");
    return items.filter(x => words.every(z => descriptionFn(x).toLowerCase().includes(z)));
}
68820cookie-checkTypescript search in array