I have seen this proposal which proposes the &
operator as a replacement of the first argument.
But considering readability, I think that the following would be a more appropriate one:
const people = [
{name: "hello", status: true},
{name: "world", status: false}
];
people.filter@.status; // [{name: "hello", status: true}]
// Equivalent to
people.filter(person => person.status);
// or
people.filter(({status}) => status);
One more syntactic sugar I think of for the frequently-used map
method:
const people = [
{name: "hello", status: true},
{name: "world", status: false}
];
people[].name; // ["hello", "world"]
// Equivalent to
people.map@.name;
// or
people.map(person => person.name);
// or
people.map(({name}) => name);