You are viewing a single comment's thread. Return to all comments →
This passed all the test cases for me.
var positive = arr.filter(item=>{ return item > 0; }); var negative = arr.filter(item=>{ return item < 0; }); var zeroes = arr.filter(item=>{ return item === 0; }); console.log((positive.length/n).toFixed(4)); console.log((negative.length/n).toFixed(4)); console.log((zeroes.length/n).toFixed(4));
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 →
This passed all the test cases for me.