In my TypeScript code, I have the following snippet:
public executeTest(test: Test): void {
const testFilters: Record<string> = getTestFilters();
let isTestingRequired: boolean = false;
for (let i: number = 0; i < testFilters.length; i++) {
if(test.Name === testFilters[i].Name){
isTestingRequired = true;
break;
}
}
}
I attempted to replace the above for loop with LINQ as shown below, but encountered errors.
let isTestingRequired: boolean = testFilters.any((filter.): boolean => {
return filter.Name === test.Name
});