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
I find myself moving data around a lot in and out of already existing variables, and it seems that the only way to do so is having a series of assignment statements or destructuring first and looping over the new object/array to assign the values.
The proposed syntax would be:
existing.{one,two} = {one:1, two:2, three:3}
for object destructuring and:
existing.[ 0..1 ] = [1,2,3,4,5,6,7]
AND
existing.[ 0, 1, 5] = [1,2,3,4,5,6,7]
The text was updated successfully, but these errors were encountered:
More discussion of this idea can be seen at #3225 (and probably a few other places). I think it's a great idea, though your second last example exists (existing[0..1] = [1,2,3,4,5,6,7]) and your last example would make as much sense as an object de/restructuring (existing.{0, 1, 5} = [1,2,3,4,5,6,7]).
I find myself moving data around a lot in and out of already existing variables, and it seems that the only way to do so is having a series of assignment statements or destructuring first and looping over the new object/array to assign the values.
The proposed syntax would be:
existing.{one,two} = {one:1, two:2, three:3}
for object destructuring and:
existing.[ 0..1 ] = [1,2,3,4,5,6,7]
AND
existing.[ 0, 1, 5] = [1,2,3,4,5,6,7]
The text was updated successfully, but these errors were encountered: