Files
freecodecamp--freecodecamp/curriculum/challenges/english/blocks/basic-algorithm-scripting/a77dbc43c33f39daa4429b4f.md
T
wehub-resource-sync dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 11:55:53 +08:00

98 lines
1.3 KiB
Markdown

---
id: a77dbc43c33f39daa4429b4f
title: Boo who
challengeType: 1
forumTopicId: 16000
dashedName: 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`.
```js
assert.isTrue(booWho(true));
```
`booWho(false)` should return `true`.
```js
assert.isTrue(booWho(false));
```
`booWho([1, 2, 3])` should return `false`.
```js
assert.isFalse(booWho([1, 2, 3]));
```
`booWho([].slice)` should return `false`.
```js
assert.isFalse(booWho([].slice));
```
`booWho({ "a": 1 })` should return `false`.
```js
assert.isFalse(booWho({ a: 1 }));
```
`booWho(1)` should return `false`.
```js
assert.isFalse(booWho(1));
```
`booWho(NaN)` should return `false`.
```js
assert.isFalse(booWho(NaN));
```
`booWho("a")` should return `false`.
```js
assert.isFalse(booWho('a'));
```
`booWho("true")` should return `false`.
```js
assert.isFalse(booWho('true'));
```
`booWho("false")` should return `false`.
```js
assert.isFalse(booWho('false'));
```
# --seed--
## --seed-contents--
```js
function booWho(bool) {
return bool;
}
booWho(null);
```
# --solutions--
```js
function booWho(bool) {
return typeof bool === 'boolean';
}
booWho(null);
```