Closure function

https://www.codingem.com/javascript-closures/
A Closure function is a function that can access to the variables declared in the outer context, including global variables.
In JavaScript, closure means an inner function can access variables that belong to the outer function.
This is not a closure:
//Named function
function greetings() { //this is not a closure function.
return ‘omar’;
}
//anonimous function
var greetings2 = function () { //this is not a closure function.
return ‘rami;
}
greetings(); //omar
greetings2(); //rami




