Proposal: Selector/Select Expression
simonfarrugia26 at gmail.com
Fri Jun 21 16:47:25 UTC 2019
New syntax will always look a bit odd at first until we get used to it.
I sometimes find nested arrow functions a bit confusing to understand where
one function starts and where it ends particularly when they are one liners.
This syntax is more concise and personally I find it more readable.
Reasons for the leading dot notation is because I think it's intuitive and
also self explanatory:
1) We just remove what is in common on both ends of the expression (like
simplifying an algebraic expression).
const getEmail = user => user.contacts.email;
2) The leading dot indicates that the expression reads the property of an
object that is not statically defined.
const getEmail = .contacts.email;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss