Comment by jansommer
Comment by jansommer 4 days ago
Wouldn't the query for your example just be
data.filter(d => d.friends.includes("John")).map(d => ({name: d.name+" "+d.lastName}))
Maybe I'm missing the bigger picture, but that doesn't seem so bad
one of the cases something like this is useful for is when you have user configured saved 'filters' - you can simply pass the stored object into the where clause. I agree if you're doing hard-coded queries on arrays of objects, this may not add a lot. That said, a consistent syntax for doing searches and mapping is useful - projects like lodash have that as part of their api too.