this post was submitted on 21 Apr 2024
9 points (100.0% liked)

Programmer Humor

32119 readers
726 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] gaael@lemmy.world 1 points 5 months ago (1 children)

You'll find an npm package to help you count up to 2.

(I recently learned - maybe here - that the is-even package has over 170k weekly downloads)

[โ€“] Drusenija@lemmy.world 1 points 5 months ago

What's even wilder is if you look at the code of that package, all it does is include the is-odd package and then return !is-odd. And the is-odd package isn't much better, it does some basic checks on the input and then returns n % 2 === 1.