You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but no dice. It looks like currently this is a syntax error, so adding support shouldn't (?) break existing code.
More generally, destructuring assignment should probably work like:
[x, y] = [1,2] // x = 1, y = 2
[x, y,..., z] = [1,2,3,4,5] // x = 1, y = [2, 3, 4], z = 5{a, b}={a =1, b =2}// a = 1, b = 2{x = a, y = b}={x =5, y =7}// a = 5, b = 7
It'd also make sense to support the syntax in function arguments:
map (f) over ([head, tail,...])=
f (head).concat (map (f) over (tail))// obviously needs a check for the base case but you get the idea
Thoughts?
The text was updated successfully, but these errors were encountered:
There doesn't appear to be any support for destructuring objects or arrays during assignment.
I tried the following code:
expecting it to produce JS equivalent to:
but no dice. It looks like currently this is a syntax error, so adding support shouldn't (?) break existing code.
More generally, destructuring assignment should probably work like:
It'd also make sense to support the syntax in function arguments:
Thoughts?
The text was updated successfully, but these errors were encountered: