List Filtering
DESCRIPTION
In this kata you will create a function that takes a list of non-negative integers and strings and returns a new list with the strings filtered out.
Example
1 | filter_list([1, 2, "a", "b"]) == [1, 2]; |
SOLUTION
- 数组的
filter()
方法
1 | function filter_list(l) { |