这是一个代码
var collection = (function (){
var x = 0;
return {
y : x,
get : function(){return x},
set : function(n) { x = n}
}
}());
collection.set(1000);
Run Code Online (Sandbox Code Playgroud)
为什么collection.y != collection.get()?
这是一段代码
function test() {
this.value = "foo";
}
$(document).ready(function () {
test();
alert(this.value); //--> return undefined
alert(window.value); //--> return 'foo'
});
Run Code Online (Sandbox Code Playgroud)
有人能解释一下这些结果吗?
问候
萨尔瓦多
如果我想限制用于访问网站的电子邮件地址,使用Persona有什么好处?我必须以同样的方式管理我服务器上的授权电子邮件地址吗?缺少什么?