|
|
@ -3,7 +3,6 @@ const infiniteList = require('.'); |
|
|
|
const increment = i => i + 2; |
|
|
|
const infinite = infiniteList.create(0, increment, 10); |
|
|
|
|
|
|
|
// infinite;
|
|
|
|
console.log(infinite.top()) |
|
|
|
console.log(infinite.last()) |
|
|
|
|
|
|
@ -17,11 +16,10 @@ console.log(infinite.top().next().next().toString()) |
|
|
|
|
|
|
|
console.log(infinite.take(5)) |
|
|
|
|
|
|
|
const gen = infinite[Symbol.iterator]; |
|
|
|
gen(); |
|
|
|
|
|
|
|
for(let i of infinite) { |
|
|
|
// if(i.index > 100) break;
|
|
|
|
if(i.index > 100) break; |
|
|
|
// console.log(infinite.get(5).value);
|
|
|
|
console.log(i.value.toString()); |
|
|
|
} |
|
|
|
|
|
|
|
console.log(infinite.clearCache()); |