Hacker News new | ask | show | jobs
by tlrobinson 2983 days ago
"do" expressions have been proposed as well: https://github.com/tc39/proposal-do-expressions

Babel supports it if you want to live on the bleeding edge: https://babeljs.io/docs/plugins/transform-do-expressions/

It would be kind of neat if JSX implicitly used "do" expressions in children expressions, though the ternary operator is already very useful in JSX, and more concise [1]

1. https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEBhCB...