Given an array with positive and negative numbers, separate them such that negatives come before all positives, maintaining their actual order code example
Example: sort array with negative numbers
var arr = [10, 5, 40, 25, -3412, 4212, -107.578, 97.453];
function sortNumber(a, b) {
return a - b;
}
return arr.sort(sortNumber);