I'm still confused about this part of the closure although I read about it a lot (also here in the site). Took the code from here: http://www.crockford.com/javascript/private.html
So what is the different between this:
function Container(param) {
this.member = param;
}
...And this -
function Container(param) {
var member = param;
// and also in case it's without "var", I.e. global
}
Please explain what happens when you're creating the obj for each case -
var myContainer = new Container('abc');
Also - What are the access differences for the parameter from the object? And can you give example for a function as a parameter and a returning function?
Thanks a lot!