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

2

u/MarceauKa Jun 07 '21

Should I be worried about all these flames around me?