Categories > Coding > Javascript >

[RELEASE] UNHOLY ISEVEN

SeizureSalad

i love femboys

Posts: 1153

Threads: 79

Joined: Mar, 2021

Reputation: 36

Posted

title says it all. this works. better than a giant ass if else.

function isEven(num) {
  if(num === 0) {
    return true;
  }
  else if(num < 0) {
    return isEven(-num);
  }
  return !isEven(num - 1);
}
  • 0

"Questionable intellegence, but I like the mystery" - CubeFaces

https://cdn.discordapp.com/attachments/1136067487847415848/1138948596679589898/sig.png

Posts: 1391

Threads: 71

Joined: May, 2022

Reputation: 17

Replied

this is unholy

  • 0

Did I mention I use arch btw?

Posts: 19

Threads: 4

Joined: Jul, 2021

Reputation: 4

Replied

const isEven = n => !Boolean(n % 2)
  • 0

ChargedX

Owner of ChargedX

Posts: 97

Threads: 6

Joined: Jul, 2022

Reputation: -10

Replied

this is super unholy

  • 0

https://cdn.discordapp.com/attachments/980336249820831744/1016151409261027428/standard_1.gif

https://cdn.discordapp.com/attachments/994242253864312843/1016368013534052453/standard_3.gif

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )