My array looks like this:
const arr = [{id: "12f"},{id: "12F"},{id: "13"}]
const itemToBeFound = {id: "12f"}
I'm trying to locate that item using a method like RegExp(/12f/i).test(string)
The reason for using the regexp is to make the search case insensitive. I'm aware that I could use toLowerCase or toUpperCase, but I'm curious about using this approach.
So I attempted
arr.find(({id}) => id == regexp)
in that direction. However, I haven't yet found a way to make it work.