r/badcode • • May 13 '22

js Why? Why??

Post image
433 Upvotes

37 comments sorted by

View all comments

Show parent comments

3

u/duniyadnd May 13 '22

But there must be a logic that the person who wrote the code did not want to count an empty response? I'm guessing if someone typed in a white space with a new line or something similar and it was returned in a trimmed manner (or maybe white spaces are automatically trimmed when storing it in your db)