Refering to How do JavaScript closures work?.
Closure is:
- a closure is the local variables for a function — kept alive after the function has returned, or 
- a closure is a stack-frame which is not deallocated when the function returns (as if a 'stack-frame' were malloc'ed instead of being on the stack!). 
Just want to confirm are the following consider closure?
1) Binding javascript function within a function.
var Books = {
    init:function(){
        $('#box').bind('click',function(){
           console.log('click'); 
        });
    }
};
Books.init();
2) Declare a function within a function
function sayHello(name) {
  var text = 'Hello ' + name;
  var sayAlert = function() { alert(text); }
}   
var hello = sayHello();
I still can't differentiate which is closure for some times, is that all function within function consider closure or only the one that keep the returned inner function as variable/reference. Example:
function sayHello(name) {
  var text = 'Hello ' + name;
  var sayAlert = function() { alert(text); }
  **return sayAlert;**
}
 
     
     
    