Hello,
I found an issue with the array destructuring assigment (I checked and I didn't find it in the list):
[res[i], res[j]] = [res[j], res[i]];
returns
unsupported expression pattern in destructuring: /home/...
Thanks for your amazing work by the way :)
yes,
let a = [1,2,3]
let i = 0, j = 1;
//[a[i], a[j]] = [a[j], a[i]] // error
let [c, d] = [a[i], a[j]] //ok
This should also be valid:
const obj: any = {};
const obj2: any = {};
const arr = [1];
[obj.one] = arr;
({one: obj2.one} = obj);
// obj === { one: 1 }
// obj2 === { one: 1 }
but Flow gives an error:
[obj.one] = arr;
^ unsupported expression pattern in destructuring
({one: obj2.one} = obj);
^ unsupported expression pattern in destructuring
@vkurchatkin @calebmer is this issue anywhere on the roadmap?
Would also be very interested in this.
Any news on this one? This is ridiculous.
Most helpful comment
This should also be valid:
but Flow gives an error: