What is the difference between the following pieces of javascript?
I see the first one often in minified code, but the second one costs fewer bytes, and they seem to do the same thing. Why do minifiers use the first one, not the second?
!function() {
let myLocalVar = 5;
console.log('Hello world', myLocalVar);
}();
{
let myLocalVar = 5;
console.log('Hello world', myLocalVar);
}