标签:color io os java ar for sp cti on
若干个非常容易弄错的javascript内容。
var obj1 = new Object();
var obj2 = obj1;
obj1.name = “aa”;
alert(obj2.name);//结果是”aa”
function setname(obj){
obj.name = “aa”;
obj = new Object();
obj.name = “bb”;
}
ver person = new Object();
setname(person);
alert(person.name);//结果是”aa”
if(true){
var color = “red”;
}
alert(color);//结果是”red”
for(var i=0;i<10;i++){
//doSomeThing();
}
alert(i);//结果是10
标签:color io os java ar for sp cti on
原文地址:http://www.cnblogs.com/kakuroseu/p/3973795.html