function isEven(n) {
let arr = [];
let sign = -1;
for (let i = 0; i < Math.abs(n); ++i) {
arr = [...arr, sign];
sign *= -1;
}
return arr.length === 0 || arr.reduce((a, b) => a + b) === 0;
}
But I'm not going to test it, because I'm doing productive things on my computer right now, and don't want to OOM.
Sadly, the OP missed an opportunity to call his program "blazingly fast" [0].
Sadly, the OP missed an opportunity to call his program "blazingly fast" [0].
[0] https://www.youtube.com/results?search_query=primagen+blazin...