日期:2014-05-16 浏览次数:20365 次
var uid = 1; function newId(){ return uid++; } newId(); // 1 newId(); // 2
function newId(){ var thisFun = arguments.callee; if(!thisFun.uid) thisFun.uid = 1; return thisFun.uid++; } newId(); // 1 newId(); // 2