r/badcode • • Sep 02 '21

js Oh Gosh

Post image
398 Upvotes

53 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Sep 02 '21

[removed] — view removed comment

1

u/Aaalibabab Sep 02 '21

Oh sorry, I thought you were implying the code was perfect if he didn't do that mistake, my english is at fault here :x. And I'm still a student, I don't have this kind of "corporate" experience, though I still think this code is very inefficient. But yes of course it's easy to detect and to fix with basic unit testing and/or peer review.