You are viewing a single comment's thread. Return to all comments →
function plusMinus(arr: number[]): void { const d: number = arr.length; let p: number = 0; let z: number = 0; let n: number = 0; arr.forEach((num): number => num > 0 ? p++ : num < 0 ? n++ : z++); [p, n, z].forEach((c): void => console.log((c/d).toFixed(6))); }
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 →