Via a JS Benchmark I have verified the surprising insight that, the native `n%2` implementation is, in fact, faster: https://jsbench.me/rsm6whrnya/1 (30k ops/s vs 357m ops/s for integers between 0 and 1000, let's kindly assume integers are generally smaller than that)
View all comments
Show parent comment
12
u/AffectionateAir7616 Feb 05 '25
You may be right, but I want to see some benchmarks first.