Use Destructuring Assignment to Assign Variables from Arrays and predefined code

I am new to JavaScript and ES6. Would someone please help me in understanding this code used in above mentioned qs?

(() => { })();

It’s an IIFE ( link to MDN Glossary ) where you can pass in arguments and then executes it into the curly brackets.
This
( (par1, par2) => { console.log('par1', par1); return par1*par2 })();
is the same as

function xyz (par1, par2) { console.log('par1', par1); return par1*par2 };
xyz();
1 Like