In this function, variable midArc stores positive and negative numbers. How can these values be used to create two new arrays, one containing positive values and another one containing negative values?
function cosVal(){
var val = [2,5,7,6,9];
for(i=0; i<val.length; i++){
var midArc = Math.cos(val[i]);
alert(midArc); //displays 3 positive and 2 negative numbers
}
}