Given the following nested array write code that prints all the non-negative numbers in each sub-array that occur before a negative number.
Tip: First do it for the first subarray and then write a loop to do it for all the subarrays
CODE TEMPLATE
function printUntilNegative(arr){
// write your code here
}
let arr = [[1,2,-3,5],[5,0,-4,7,8],[-1,5,6],[4,5,-6,8,-9]];
printUntilNegative(arr);// should print 1 2 5 0 4 5