mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-22 21:08:12 +08:00
Some checks failed
i18n - Build Validation / Validate i18n Builds (20.x) (push) Has been cancelled
CI - Node.js / Lint (20.x) (push) Has been cancelled
CI - Node.js / Build (20.x) (push) Has been cancelled
CI - Node.js / Test (20.x) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 20.x) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 20.x) (push) Has been cancelled
i18n - Download Client UI / Client (push) Has been cancelled
Co-authored-by: Naomi <accounts+github@nhcarrigan.com>
1.3 KiB
1.3 KiB
| 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);