尽管我读了很多(也在网站上),但我仍然对关闭的这一部分感到困惑。从这里获取代码: 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
}
请解释为每种情况创建 obj 时会发生什么 -
var myContainer = new Container('abc');
另外 - 对象参数的访问差异是什么?你能举一个函数作为参数和返回函数的例子吗?
非常感谢!