I read this post Use of [square brackets] around JavaScript variables, but I din't really get the idea why to use. This is the code I'm trying to understand:
let [translations] = await translate.translate(text, target);
translations = Array.isArray(translations) ? translations : [translations];
translations.forEach((translation, i) => {
console.log(`${text[i]} => (${target}) ${translation}`);
Can you help explaining me why the brackets in first line, and why the if statement in the second line?