Closures

2/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?

function remember(secret) { return function () { console.log(secret); } } const sayA = remember('foo'); const sayB = remember('bar'); sayA(); sayB();

Choose one