You are viewing a single comment's thread. Return to all comments →
Typescript:
let result_posative = 0; let result_nagative = 0; let result_zero = 0; for(let i=0;i<arr.length;i++){ if(arr[i] > 0) { result_posative++; } else if(arr[i] < 0) { result_nagative++; } else { result_zero++; } } console.log(result_posative / arr.length); console.log(result_nagative / arr.length); console.log(result_zero / arr.length);
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Typescript: