Closures

3/5

Access variables defined in the current function's scope and the scope of any parent function or the global scope.


What is printed to the console?

let secret; function remember(arg) { secret = arg; return function () { console.log(secret); } } const sayA = remember('hello'); const sayB = remember('world'); sayA(); sayB();

Choose one