trying to get a count from an array in javascript

hey guys new to javascript and trying to run a simple count procedure in arrays

i have built an array from some prompts and am now trying to run a loop through to count negative and positive numbers

i understand the for loop context, would i have to build another emtpy array and push results to it?

this is what i have written up so far…

let array2 = []
    for (let i = 0; i < numberCount; i++) {
        if (array[i] > 0) {
            i == 1
            array2.push(i)
        }
    }

any help appreciated, dont burn me to hard!

Leave a Comment