|
|
|
|
|
by the_gipsy
1472 days ago
|
|
> It's not. It's just regular code - there are no differences. > All statements in JS can be expressed as expressions directly (ternary/array methods) or indirectly (nested within a function expression), so there's no loss of functionality - it's not even really a subset in that sense. Do you not see the contradiction? |
|
Vanilla javascript assignments can be any expression.
JSX assignments (the brackets) can be any expression.
There's no weirdness nor extra limitations to JSX assignments compared to normal vanilla JS. It works exactly the same.
If you think not being able to assign JS blocks is weird you're going to have to explain to me what this piece of JS code would do: