https://blog.csdn.net/longyin0528/article/details/80504282
function createIterator (items){
var i =0;
var _add = function() {
var num = items[0]+ items[1];
return num;
};
return {
showadd:function(){
var num_result = _add();
return num_result;
}
}
}
var iterator= createIterator([1,2]);
console.log(iterator.showadd());
原文地址:https://blog.51cto.com/13968096/2395867
时间: 2024-10-31 06:41:42