Comment

Comment by haswell

JavaScript supports the modulo operator and the native syntax for this:

  let isEven = theNumber % 2 == 0;
There are reasons to dislike JavaScript, but this isn’t it. The native solution is about as standard as it gets.
parent haswell 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton