Related to: How to fix Eslint error "prefer-destructuring"?.
I Have:
method (v100) => {
let L,
H;
if (v100 <= 70) {
const obj = {L: 1, H: 2};
L = obj.L;
H = obj.H;
} else {
L = ((0.8353 * (v100 ** 2)) + (14.67 * v100)) - 216;
H = ((0.1684 * (v100 ** 2)) + (11.85 * v100)) - 97;
}
return ((L - 40) / (L - H)) * 100
}
and changed it to
{ L } = obj;
{ H } = obj;
as written in the answer. But now I get an Unexpected token error.
It should also be possible to write it like this, right?:
{ L, H } = obj;