[CI Skip] 0.7.1

This commit is contained in:
Travis CI
2017-12-11 19:40:48 +00:00
parent 77fccc3760
commit b659622384
5 changed files with 71 additions and 12 deletions
+23
View File
@@ -0,0 +1,23 @@
# array
Utility methods that operates on arrays
- [arrayFilter](#arrayfilter) Filters undefined and (optionally) null values from an array
## arrayFilter
Filters undefined and (optionally) null values from an array
```js
arrayFilter (array: Array<any>, allowNulls: boolean = true): Array<any>
```
Returns a new array with all `undefined` values removed. Optionally, when `allowNulls = false`, it removes the `null` values as well
```js
import { arrayFilter } from '@polkadot/util';
arrayFilter([0, void 0, true, null, false, '']); // [0, true, null, false, '']
arrayFilter([0, void 0, true, null, false, ''], false); // [0, true, false, '']
```