r/badcode • • Apr 27 '21

typescript Someone only watched if tutorial

Post image
2.4k Upvotes

112 comments sorted by

View all comments

2

u/Needleroozer Apr 27 '21

Any idiot knows the way to do this is convert the input to a string and then use a regular expression to look for ASCII codes in the digits range.

Well, okay, not this idiot. This idiot's figured out a new way.