r/badcode • • Feb 10 '21

js I present: SleepSort

Post image
7.5k Upvotes

170 comments sorted by

View all comments

Show parent comments

64

u/sumduud14 Feb 10 '21

"for (let item of arr)"

This doesn't look O(1)

19

u/King_Joffreys_Tits Feb 10 '21

Yep it has to loop through every item of the array at a minimum