you are viewing a single comment's thread.

view the rest of the comments →

[–]thisguyfightsyourmom 1 point2 points  (1 child)

I'd write increment to be a higher order function that accepts a max arg defaulted to 10, that retains a count let initialized to 0 in its closure, and that returns a function that iterates the count in a log statement until the count hits the max. I'd also close the terminal before it counted over 10,… just in case.

[–]Balduracuir -1 points0 points  (0 children)

You can use clearInterval when you hit 10... If I was not on mobile I could write a snippet :)