4 ms·
"do" expressions have been proposed as well: https://github.com/tc39/proposal-do-expressions https://github.com/tc39/proposal-do-expressions Babel supports it
by tlrobinson 9y ago
"do" expressions have been proposed as well: https://github.com/tc39/proposal-do-expressions 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/ 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/#N4Igxg9gdgLgprEAuc0DOMAEBhCBbAB2gRgHUBLGACwBEJMBeTACmEwDMJ6BfASkYB8mADwATcgDcBwUfTbl2zThH5thaAgEMoAquWEB6DdqHdMcADZo4mNeKkAjAJ6H7p7t1eSBAHSh-IKAwcfCIoEgpqABU4ACcoTVinRhY2ZUw+QRE3NK5MAH4RYx09Q2KhJGzvZy8pDNqBEAAaEAgCGHJ0ZFBE2IgAdwAFRIQ0ZBBNCQhyUWaQB1jNMABrOBgAZS0wcigAc2QYWIBXOBad61iYQcXdvE1kdk0rU5AAKzQADwAhRZW19c0eDgABkdnAHk9rC0tLELuMHJpnBZoHMCLEdmQZtRkAAOAAM0L61lIiwI4zRcAuEnBLVicAAjkdyHTrppbvckI9ni1rHhyAdji80DtdhY4ABFI4QeAQ7kgGCIiiibFIABMLUOmnIFhFuDwd3GUGIcyO1iiiLGnMhcA8QA https://prettier.io/playground/#N4Igxg9gdgLgprEAuc0DOMAEBhCB...