I need to reassign the value of two differents variables. My code is like this:
const func = () => {
do something;
return {a, b}
}
Then I declare the two variables outside a if/else block with let :
let a = b = '';
And in the if/else i need to assign to the two variables the value returned form the function:
if(condition) {
a, b = func();
}
How can i reassign the value returned from the function to the variables?
Aucun commentaire:
Enregistrer un commentaire