Oliver Eyton-Williams 0bd52f8bd1
Feat: add new Markdown parser (#39800)
and change all the challenges to new `md` format.
2020-11-27 10:02:05 -08:00

1.3 KiB

id, title, challengeType, forumTopicId
id title challengeType forumTopicId
a77dbc43c33f39daa4429b4f Boo who 5 16000

--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.strictEqual(booWho(true), true);

booWho(false) should return true.

assert.strictEqual(booWho(false), true);

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

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

booWho([].slice) should return false.

assert.strictEqual(booWho([].slice), false);

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

assert.strictEqual(booWho({ a: 1 }), false);

booWho(1) should return false.

assert.strictEqual(booWho(1), false);

booWho(NaN) should return false.

assert.strictEqual(booWho(NaN), false);

booWho("a") should return false.

assert.strictEqual(booWho('a'), false);

booWho("true") should return false.

assert.strictEqual(booWho('true'), false);

booWho("false") should return false.

assert.strictEqual(booWho('false'), false);

--seed--

--seed-contents--

function booWho(bool) {
  return bool;
}

booWho(null);

--solutions--

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

booWho(null);