Write a function named partitionArray
that receives 2 parameters:
numbers
predicateCallback
The function should return an Object with 2 properties:
pass
- an Array with all the numbers that pass the test implemented by the predicateCallback
fail
- an Array with all the numbers that do not pass the test implemented by the predicateCallback
NOTE: the order of the numbers in the
pass
andfail
arrays should be the same as in thenumbers
array
numbers
=predicateCallback
=(nr) => nr % 2 === 0