2 ms·
I like that order, it matches how I'd work with a Javascript list of objects: users.filter((u) => u.lastName == "foo").map((u) => [u.id, u.firstName]); Py
by 8organicbits 4y ago
I like that order, it matches how I'd work with a Javascript list of objects:
users.filter((u) => u.lastName == "foo").map((u) => [u.id, u.firstName]);
Python looks like the original SQL if you do it as a list comprehension:
[ (user.id, user.firstName) for user in users if user.lastName == "foo" ]