by Pawan Kumar @jsartisan
What will be the output in console for the following code:
function makeWorker() {
let name = "Pete";
return function () {
alert(name);
};
}
let name = "John";
let work = makeWorker();
work(); // what will it show?