let test12 = [-1, -2, -3];
I'm having trouble with this one. I've been able to solve it for positive integers using the code below, but I'm not sure how to modify it for negative numbers.
let test = [1 , 2, 3];
var largest= 0;
for (i=0; i<=test.length;i++){
if (test[i]>largest) {
largest=test[i];
}
}
console.log(largest);