Javascript: difference between using an IIFE and a block statement
IIFE are mainly used to encapsulate scope
(function () {
let myVar = 10; // not global
// ...
}());
but why not just use a block statement?
{
let myVar = 10; // also not global
// ...
}
are there other benefits for using IIFE further than scope encapsulation?