by wruza · 3y ago · 0 comments
If the motivation behind these features are React components, javascript clearly lacks proper logic in array (and object) literals, like
'[' if (cond) […]expr1 [else […]expr2] ']'
Although it seems pretty strange to add syntax only because some specific user interface library together with a specific language extension could benefit from it. [cond ? expr1 : expr2]
Or maybe this: [(() => {/*code*/})()] [...(cond ? [expr1] : [])]