I want to define a variable in a function signature and then re-assign that variable later. The following code is what I am trying to do, but am getting a Identifier 'b' has already been declared
error:
async function test (a, b = 'myTest', c = undefined) {
let { b, c } = normalizeInput(b, c)
...
}
目的是保留初始变量名。我怎样才能做到这一点?
Edit: if I remove the let
, I get Unexpected token
for the =
.
你可以做:
Read more about need of parentheses here
refer https://stackoverflow.com/a/61788704/5190838