Tianhe Gao

Boo who

  1. Basic Algorithm Scripting: Boo who | freeCodeCamp.org
  2. Boolean - JavaScript | MDN
  3. freeCodeCamp Challenge Guide: Boo who - Guide - The freeCodeCamp Forum

我写的

function booWho(bool) {
  if (bool === false || bool === true) {
    return true
  } else {
    return false
  }
}

console.log(booWho(1))

还可以这样写:

function booWho(bool) {
  return typeof bool === 'boolean'
}

console.log(booWho(1))

Welcome to tell me your thoughts via "email"
UP