1.
}
varsayAlert=say667();
gSetNumber=function(x){num=x;}
}
}
setUpSomeGlobals();//為三個全域變數賦值
gAlertNumber();//666
gIncreaseNumber();
gAlertNumber();//12
returnresult;
}
functiontestList(){
varfnlist=buildList([1,2,3]);
for(varj=0;j
functiontionalsays() varsayAlert=function(){alert(alice);}
varalice='HelloAlice';
returnsayAlert;
varhelloAlice=sayAlice();
helloAlice();//HelloAlice
anArray.push(num );
alert('num:' num 'nanArray' anArray.toString() 'nref.someVar' ref.someVar);
}
closure1=newClosure(40,{someVar:'closure1'});