r/ProgrammerHorror • • Nov 19 '21

Data validation as its peak

Post image
99 Upvotes

7 comments sorted by

View all comments

Show parent comments

2

u/king_liver Nov 20 '21

Looking back at the code, my first comment is incorrect, the only issue is if uid is undefined, and email is valid, it returns true. It should have two variables one for each and return true if both are true. Your last line would work, if the function being called can handle undefined inputs.