我想在JavaScript中创建类似C#LINQ的参数。我在GitHub中找到了这个Sample,但是我需要为我的项目自定义此参数。
T defined in a class, look at the GitHub link.
Where(predicate: (value?: T, index?: number, list?: T[]) => boolean): void{
//I want access to parameter here, but i don't know how.
//I want 'x' & '>' & '2'
}
Usage: Where(x => x!.id > 2);