Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function sequence([prev, current]){
- console.log(current, prev)
- return [current, prev+current];
- }
- let promise = Promise.resolve([0, 1]);
- for(let i = 0; i < 1000; i++){
- promise = promise.then(sequence)
- }
- promise.then(([prev, current]) => console.log(current));
Add Comment
Please, Sign In to add comment