Files

1.3 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
a77dbc43c33f39daa4429b4f Boo who 1 16000 boo-who

--description--

Check if a value is classified as a boolean primitive. Return true or false.

Boolean primitives are true and false.

--hints--

booWho(true) should return true.

assert.isTrue(booWho(true));

booWho(false) should return true.

assert.isTrue(booWho(false));

booWho([1, 2, 3]) should return false.

assert.isFalse(booWho([1, 2, 3]));

booWho([].slice) should return false.

assert.isFalse(booWho([].slice));

booWho({ "a": 1 }) should return false.

assert.isFalse(booWho({ a: 1 }));

booWho(1) should return false.

assert.isFalse(booWho(1));

booWho(NaN) should return false.

assert.isFalse(booWho(NaN));

booWho("a") should return false.

assert.isFalse(booWho('a'));

booWho("true") should return false.

assert.isFalse(booWho('true'));

booWho("false") should return false.

assert.isFalse(booWho('false'));

--seed--

--seed-contents--

function booWho(bool) {
  return bool;
}

booWho(null);

--solutions--

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

booWho(null);