r/shittyprogramming • • Jun 07 '21

isEven with regex in javascript

const isEven = n => 'x'.repeat(n).replace(/xx/g, '') === '';
102 Upvotes

12 comments sorted by

View all comments

Show parent comment

23

u/[deleted] Jun 07 '21

Over 200k weekly downloads, lol wtf.

Mod operator: am I a joke to you?