re: Welcome Thread - v15 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: [deleted]

here's one way:

const myFunc = (number) => 
  number === 1 ? 0 : number === 0 ? 1 : null;

myFunc(1)
// 0

myFunc(0)
// 1

myFunc(2)
// null
code of conduct - report abuse