Categories > Coding > Javascript >

[RELEASE] UNHOLY ISEVEN


SeizureSalad

i love femboys

Posts: 862

Threads: 49

Joined: Mar, 2021

Reputation: 23

  • 0

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);
}

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

https://cdn.discordapp.com/attachments/908778288426651739/928478435066642492/siggy_1.png

Whoman

#3561

Posts: 890

Threads: 46

Joined: May, 2022

Reputation: 9

  • 0

Replied

this is unholy

https://i.imgur.com/21V9TOF.png

RealNickk

Nicholas (Nick)

vip

Posts: 3863

Threads: 172

Joined: Feb, 2020

Reputation: 47

  • 0

Replied

const isEven=n=>!!(1-n&1);

 

https://github.com/RealNickk

check out my github i make stuff

Posts: 14

Threads: 3

Joined: Jul, 2021

Reputation: 1

  • 0

Replied

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

ThatPhoenix

Dopemine Addict

Posts: 2843

Threads: 61

Joined: May, 2020

Reputation: 22

  • 0

Replied

NOO THIS IS UNHOLY

https://cdn.discordapp.com/attachments/661621789591470090/1013924765892890774/Untitled_1366_768_px_1546_202_px_3.gif

Join Vector 

Phoenix#8419 | JavaScript & C# | Learning C/C++

ChargedX

Owner of ChargedX

Posts: 103

Threads: 6

Joined: Jul, 2022

Reputation: -10

  • 0

Replied

this is super unholy

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 )