Problem
Is it possible to overwrite multiple variables assigned with let
const somefunction = (data) => ({a:1+data, b:2-data, c: 2*data, d: 3+1*data})
let {a, b, c, d} = somefunction(3)
Now, how can one overwrite {a, b, c, d} in one statement after calling someFunction with a different argument?
Possible Solutions
Not working! (obviously)
const somefunction = (data) => ({a:1+data, b:2-data, c: 2*data, d: 3+1*data})
let {a, b, c, d} = somefunction(3)
{a, b, c, d} = somefunction(5)
Working
This seems to work, but my prettier will remove the leading semicolon (+ the syntax is crazy)
const somefunction = (data) => ({a:1+data, b:2-data, c: 2*data, d: 3+1*data})
let {a, b, c, d} = somefunction(3)
;({a, b, c, d} = somefunction(5))
are there other ways?