News for hackers. Stuff that matters.
Re:Pipe Operator (|>) For JavaScript by wruza on Friday January 20, 2023 @06:35PM (#34461719)
React component should be chock full of do expressions

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.
Re:Pipe Operator (|>) For JavaScript by MathMonkeyMan on Friday January 20, 2023 @11:17PM (#34463836)
Do you mean this?

    [cond ? expr1 : expr2]
Or maybe this:

    [(() => {/*code*/})()]
Re:Pipe Operator (|>) For JavaScript by wruza on Saturday January 21, 2023 @01:28AM (#34464371)
More like this:

  [...(cond ? [expr1] : [])]