Filtering Odd and Even Number Arrays Function

The function has 2 parameters that accepts an array and a boolean
value. First, the array is sorted in numerically ascending order. If
the 2nd parameter is "false" or null (not undefined, but empty), an
array is created with all the odd numbers of the array once it has been
filtered using a previously established function. Otherwise, an array
is created with all the even numbers of the array once it has been
filtered using another previously established function. Both arrays are
returned out of the function.