function countPositivesSumNegatives(input) { if (!input || input.length === 0) { return []; } var total1 = 0; var total2 = 0; for (i = 0; i < input.length; i++) { if (input[i] > 0) { total1 += 1; } if (input[i] < 0) { total2 += input[i]; } } return [total1, total2]; }