SOURCE

function* countAppleSales(){
    var saleList = [function(t){return t},function(t){return t},function(t){return t}];
    for(var i = 0; i<saleList.length; i++){
        yield saleList[i](i)
    }
}

console.log(countAppleSales)
var myArr = countAppleSales();
console.log(myArr);
console.log(myArr.next())
console.log(myArr.next())
console.log(myArr.next())
console.log(myArr.next())

console 命令行工具 X clear

                    
>
console