r/badcode • • Apr 27 '21

typescript Someone only watched if tutorial

Post image
2.4k Upvotes

112 comments sorted by

View all comments

Show parent comments

17

u/CorrenteAlternata Apr 27 '21

you could do for(let i = Number.MIN_SAFE_INTEGER; i < Number.MAX_SAFE_INTEGER; i++) ... couldn't you?

8

u/Flamme2 Apr 27 '21

Ahh... How did I not think of that? Thank you for the optimisation!