What is a closure?

What is scope?

let name = “Paige”;function greeting(){
console.log(name);
}
function greeting(){
let message = “hello”;
console.log(message);
}

Back to what is a closure?

function outer() {
let x = 2
return function inner(y) {
return x*y
}
}
let multiplyByTwo = outer();console.log(multiplyByTwo(3));

Full-stack developer. Funny-peculiar. Lover of baking, yoga, and reading (between the lines).