partition_.partition(array, predicate)
Split array into two arrays: one whose elements all satisfy predicate and one whose elements all do not satisfy predicate.
1 2 | _.partition([0, 1, 2, 3, 4, 5], isOdd); => [[1, 3, 5], [0, 2, 4]] |
partition_.partition(array, predicate)
Split array into two arrays: one whose elements all satisfy predicate and one whose elements all do not satisfy predicate.
1 2 | _.partition([0, 1, 2, 3, 4, 5], isOdd); => [[1, 3, 5], [0, 2, 4]] |
Designed by : w10schools
service@w10schools.com
Please login to continue.