DEV Community

Discussion on: Writing code for your future self

Collapse
 
djangotricks profile image
Aidas Bendoraitis

Very good article! Thanks.

I just noticed that in the refactored code

return isLengthValid && isAlphanumeric && isUsernameTaken;

should rather be

return isLengthValid && isAlphanumeric && !isUsernameTaken;
Collapse
 
sunnysingh profile image
Sunny Singh

You're right, good catch! Maybe I should write unit tests for my article code blocks haha.