How to target e negative number from an array, and get the sum of all positive numbers?
I am trying to figure it out how to target negative numbers in an array. I have this function SummPositive( array ) { } SummPositive( [ 1, 2, 3, 4, 5, -2, 23, -1, -13, 10,-52 ] ); This is an array with negative and positive numbers.How to target all negative numbers from array, when you don't know how many negative numbers are in array? For example, I am trying to...loop to entire array, find the positive numbers, store them in another array, and make a sum (1+2+3+4+5+10+23) . But i am noob, and i don't how to do that. If possible to do this only with native js Just make a condition to check