Closures and Callbacks
Closure Reads
Read an outer variable from an inner function.
Closure Reads
closure_reads.js
const base = 10;
function addBase(value) {
return value + base;
}
const total = addBase(5);
console.log("base=" + base);
console.log("total=" + total);
closure-reads
A closure lets a function remember variables from the scope where it was created. Here the function reads `base` from the outer scope.