Writing a program to find out the sum of the negative elements and positive elements of the array
<p>My code runs well up until the point it is expected to return the result - it does not add up any of the values entered by the user. Any help please?</p>

<pre><code>a = (prompt("a:"));
b = (prompt("b:"));
c = (prompt("c:"));

negativeSum = Number(0);
positiveSum = Number(0);

var test = [a, b, c];

for (i = 0; i &lt; test.length; i++) {

    if (isNaN(test[i])) {
        alert(test[i] + " : incorrect input.");
    }

    else

    if (test[i] &lt; 0) {
        alert(test[i] + " : positive.")
        negativeSum = Number(test[i]++);
    }
    else {
        alert(test[i] + " : positive.")
        positiveSum = Number(test[i]++);
    }
}

alert(positiveSum + " : sum of +ve elements");
alert(negativeSum + " : sum of -ve elements");
</code></pre>
