We have prefer-destructuring enabled in our ESLint rules and it is giving me an error on the line of code below, but I have no idea how to use destructuring in this particular case.
modifiedResults = partition[1];
So far I have tried:
[, modifiedResults, ] = partition;
[, modifiedResults, ...] = partition;
[, modifiedResults, ...rest] = partition;
None of these work, and for the last one it is telling me that rest is not defined, which is fair enough as I was intending it as a throw away variable.
Any ideas would appreciated...
You first try should work and can be simplified as
let [, modifiedResults] = partition;
I did try it and it works, if it doesn't work it should be related to something else IMO
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With