plusMInusOne

    0

    0

    let copy = [...arr],
        bigSide = copy.length,
        neytral = copy.filter((num) => num * num === num && num + num === num),
        negative = copy.filter((num) => num < 0).length,
        positive = copy.filter((num) => num > 0).length;
    
      return [
        neytral.length > 0 ? (neytral.length * 10) / copy.length / 10 : 0,
        negative > 0 ? (negative * 10) / copy.length / 10 : 0,
        positive > 0 ? (positive * 10) / copy.length / 10 : 0,
      ].map((num) => num.toFixed(6, "") * 1);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.