📜  const evenOrOdd = (number) => { TODO: 如果数字是偶数则返回“偶数”,否则返回“奇数” if (number % 2 === 0) { 返回“偶数”; eslint-disable-next-line no-else-return } else { return "odd"; } };一行 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:36.055000             🧑  作者: Mango

代码示例1
const evenOrOdd = (number) => {
  // TODO: this should return "even" if the number is even, "odd" otherwise
  if (number % 2 === 0) {
    return "even";
  // eslint-disable-next-line no-else-return
  } else {
    return "odd";
  }
};