Files
test-repo/tests/array-filter/test.js
T

9 lines
211 B
JavaScript
Raw Normal View History

2016-12-23 19:31:38 +00:00
/* @flow */
function filterOutVoids<T> (arr: Array<?T>): Array<T> {
return arr.filter(Boolean)
}
function filterOutSmall (arr: Array<?number>): Array<?number> {
return arr.filter(num => num && num > 10)
}