2018-10-04 14:37:37 +01:00
---
id: a77dbc43c33f39daa4429b4f
title: Boo who
isRequired: true
challengeType: 5
2019-07-31 11:32:23 -07:00
forumTopicId: 16000
2018-10-04 14:37:37 +01:00
---
## Description
< section id = 'description' >
Check if a value is classified as a boolean primitive. Return true or false.
Boolean primitives are true and false.
2019-11-19 19:54:48 -05:00
Remember to use < a href = 'https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514' target = '_blank' > Read-Search-Ask< / a > if you get stuck. Try to pair program. Write your own code.
2018-10-04 14:37:37 +01:00
< / section >
## Instructions
< section id = 'instructions' >
< / section >
## Tests
< section id = 'tests' >
```yml
tests:
- text: < code > booWho(true)</ code > should return true.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho(true), true);
2018-10-04 14:37:37 +01:00
- text: < code > booWho(false)</ code > should return true.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho(false), true);
2018-10-20 21:02:47 +03:00
- text: < code > booWho([1, 2, 3])</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho([1, 2, 3]), false);
2018-10-20 21:02:47 +03:00
- text: < code > booWho([].slice)</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho([].slice), false);
2018-10-04 14:37:37 +01:00
- text: '< code > booWho({ "a": 1 })</ code > should return false.'
2019-07-27 21:16:04 -07:00
testString: 'assert.strictEqual(booWho({ "a": 1 }), false);'
2018-10-04 14:37:37 +01:00
- text: < code > booWho(1)</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho(1), false);
2018-10-04 14:37:37 +01:00
- text: < code > booWho(NaN)</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho(NaN), false);
2018-10-04 14:37:37 +01:00
- text: < code > booWho("a")</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho("a"), false);
2018-10-04 14:37:37 +01:00
- text: < code > booWho("true")</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho("true"), false);
2018-10-04 14:37:37 +01:00
- text: < code > booWho("false")</ code > should return false.
2019-07-24 01:47:32 -07:00
testString: assert.strictEqual(booWho("false"), false);
2018-10-04 14:37:37 +01:00
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```js
function booWho(bool) {
// What is the new fad diet for ghost developers? The Boolean.
return bool;
}
booWho(null);
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
function booWho(bool) {
return typeof bool === "boolean";
}
booWho(null);
```
< / section >