4 ms·
Hmm, I think a long time ago (around 2005 or 2006) JSX was briefly considered to be party of ES standard. It didn't make it, and shortly after FB introduced Rea
by deepstack 4y ago
Hmm, I think a long time ago (around 2005 or 2006) JSX was briefly considered to be party of ES standard. It didn't make it, and shortly after FB introduced React.
Think it may have being easier if JSX is just included in ES as a standard. So yes and no, JSX introduced by FB via react is a just a syntax sugar, however the original JSX is a meant to be a ES standard, with each node as a tree structure.
https://www.ecma-international.org/publications-and-standards/standards/ecma-357/ https://www.ecma-international.org/publications-and-standard...
- lucideer 4y agoYou're describing E4X. E4X and JSX are both XML-inspired syntaxes, but beyond that have relatively little in common in how they function. E4X was supported by Firefox for a while, but I think support was removed.
- jraph 4y agoThe way I see it, syntax sugar can be part of the language proper. For instance classes in JS are sugar syntax to define a function that defines fields in this and prototype members of this function. Arrow functions are sugar syntax to define functions bound to a specific this. async / await is sugar syntax for promises. for..of is sugar syntax for iterating over an iterable.