你好我用这个模式来获取一个静态变量
var uniqueID = (function() {
var id = 0; // This is the private persistent value
// The outer function returns a nested function that has access
// to the persistent value. It is this nested function we're storing
// in the variable uniqueID above.
return function() { return id++; }; // Return and increment
})(); // Invoke the outer function after defining it.
现在我试图克隆这个函数,但是备份和原始仍然返回顺序值。复制时如何“冻结”函数的状态?
谢谢