false
, null
, 0
, ""
, undefined
и NaN
. Подсказка: попробуйте преобразовать каждое значение в логическое. Не забудьте использовать Read-Search-Ask, если вы застряли. Напишите свой собственный код. bouncer([7, "ate", "", false, 9])
должен возвращать [7, "ate", 9]
.'
testString: 'assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], "bouncer([7, "ate", "", false, 9])
should return [7, "ate", 9]
.");'
- text: 'bouncer(["a", "b", "c"])
должен возвращать ["a", "b", "c"]
.'
testString: 'assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], "bouncer(["a", "b", "c"])
should return ["a", "b", "c"]
.");'
- text: 'bouncer([false, null, 0, NaN, undefined, ""])
должен возвращать []
.'
testString: 'assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], "bouncer([false, null, 0, NaN, undefined, ""])
should return []
.");'
- text: 'bouncer([1, null, NaN, 2, undefined])
должен возвращать [1, 2]
.'
testString: 'assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], "bouncer([1, null, NaN, 2, undefined])
should return [1, 2]
.");'
```