Question: ading.us/com DU301012 Coding Practice Function Expression - addition of two numbers Practice again Coding Practice Number of negative elements of the array o Write a
ading.us/com DU301012 Coding Practice Function Expression - addition of two numbers Practice again Coding Practice Number of negative elements of the array o Write a function countOfNegative that takes array arr as argument and returns the number of negative elements of this array. Examples: . The function countOfNegativel [1, 2, -3, 4]) should return 1: . The countOfNegative (-2,-41) function should return 2: The function countOfNegative [12, 4, 451) should return 0; The function countOfNegative (1) should return 0. Write your solution below 1 function countOfNegative (arr) { 2 let count - O: 2 for (i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
