false
, null
, 0
, ""
, undefined
, and NaN
.
Hint: Try converting each value to a Boolean.
bouncer([7, "ate", "", false, 9])
should return [7, "ate", 9]
.
testString: assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9]);
- text: bouncer(["a", "b", "c"])
should return ["a", "b", "c"]
.
testString: assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"]);
- text: bouncer([false, null, 0, NaN, undefined, ""])
should return []
.
testString: assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), []);
- text: bouncer([null, NaN, 1, 2, undefined])
should return [1, 2]
.
testString: assert.deepEqual(bouncer([null, NaN, 1, 2, undefined]), [1, 2]);
```