I am looking to utilize array functions such as contains and unique, but I want them to compare equality using my custom equals function.
For instance:
let arr = [{id:1,..//some more},{id:2,..//some more},{id:3,..//some more}]
I need the following code to return true by using an equals function that checks only the id property:
arr.contains({id:1,....}).
I have attempted to search for a solution but haven't been successful.
How can I achieve this? And in general, how can I implement my own equal function in TypeScript (similar to the equals function in Java).