Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.47 KB

File metadata and controls

21 lines (14 loc) · 1.47 KB

Closure 3 easy #javascript

by Pawan Kumar @jsartisan

Take the Challenge

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?

Back Share your Solutions Check out Solutions