Oliver Eyton-Williams bd68b70f3d
Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

1.8 KiB

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

Description

Check if a value is classified as a boolean primitive. Return true or false. Boolean primitives are true and false.

Instructions

Tests

tests:
  - text: <code>booWho(true)</code> should return true.
    testString: assert.strictEqual(booWho(true), true);
  - text: <code>booWho(false)</code> should return true.
    testString: assert.strictEqual(booWho(false), true);
  - text: <code>booWho([1, 2, 3])</code> should return false.
    testString: assert.strictEqual(booWho([1, 2, 3]), false);
  - text: <code>booWho([].slice)</code> should return false.
    testString: assert.strictEqual(booWho([].slice), false);
  - text: '<code>booWho({ "a": 1 })</code> should return false.'
    testString: 'assert.strictEqual(booWho({ "a": 1 }), false);'
  - text: <code>booWho(1)</code> should return false.
    testString: assert.strictEqual(booWho(1), false);
  - text: <code>booWho(NaN)</code> should return false.
    testString: assert.strictEqual(booWho(NaN), false);
  - text: <code>booWho("a")</code> should return false.
    testString: assert.strictEqual(booWho("a"), false);
  - text: <code>booWho("true")</code> should return false.
    testString: assert.strictEqual(booWho("true"), false);
  - text: <code>booWho("false")</code> should return false.
    testString: assert.strictEqual(booWho("false"), false);

Challenge Seed

function booWho(bool) {
  return bool;
}

booWho(null);

Solution

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

booWho(null);