let a = 8, b = 6;
(() => {
"use strict";
// change code below this line
// change code above this line
})();
console.log(a); // should be 6
console.log(b); // should be 8
Why we have this function that is calling itself? Why simply not write our code without the function?
It is there because the strict mode needs a scope, can’t be activated globally. To create a local scope here you have a IIFE immediately invoked function expression