📅  最后修改于: 2022-03-11 15:03:20.052000             🧑  作者: Mango
function plusMinus(arr) {
let positive = arr.filter(number => number > 0).length / arr.length;
let negative = arr.filter(number => number < 0).length / arr.length;;
let zeronums = arr.filter(number => number == 0).length / arr.length;;
return console.log(positive.toFixed(6) + '\n' + negative.toFixed(6) + '\n' + zeronums.toFixed(6))
}