Skip to content

Conversation

gildub
Copy link

@gildub gildub commented Jun 12, 2020

No description provided.

@gildub gildub mentioned this pull request Jun 12, 2020
3 tasks
@amkirschner
Copy link

Neither original nor updated closures commits have solution to actual exercise #8 (saveOutput)

@kapoorabhi
Copy link

kapoorabhi commented Oct 10, 2020

Neither original nor updated closures commits have solution to actual exercise #8 (saveOutput)

Yes, I noticed there is no solution for Challenge #8. I am actually working on them. Will do a PR once all is done.

return array[count];
};
return innerFunc;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't work as expected because the first output would be Sat as we are incrementing the counter on first iteration and it will return array[1].

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function cycleIterator(array) {
let counter = 0;

return () => {
if( counter >= array.length) counter = 0;
return array[counter++];
}
}

@gildub
Copy link
Author

gildub commented Oct 15, 2020

@amkirschner, the intent of this PR is to address solutions for challenges from 9 to 16, not 8.
That said the solution for challenge 8 already works.

const names = rollCall(['John', 'Jack', 'Paul'])
names(); // => John
names(); // => Jack
names(); // => Paul
names(); // => Everyone accounted for

@gildub
Copy link
Author

gildub commented Oct 15, 2020

@kapoorabhi, you're right the solution for challenge #8 was using a wrong index, I fixed the counter. Thanks

@hirwablessing
Copy link

Neither original nor updated closures commits have a solution to actual exercise #8 (saveOutput)

I've finished challenge #8 saveOutput and I just created a PR. We'll see if it get approved.

@gildub gildub closed this by deleting the head repository Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants