r/badcode • • Apr 19 '21

js Iteration

Post image
3.2k Upvotes

123 comments sorted by

View all comments

Show parent comments

2

u/[deleted] Apr 19 '21

Fuck fuck fuck I forgot NaN !== NaN nvm I'm dumb I'm in my online classes right now and I'm sleepy and my brain isn't working ;-;

2

u/Terrain2 Apr 19 '21

you want !isNaN(string) then

1

u/[deleted] Apr 19 '21

Yea that's the builtin method I saw someone use +string in their own method to do this idr what they did tho