Ad
  • Default User Avatar

    I tried this code and it gives some strange errors please check why it is not passing

    function betterThanAverage(classPoints, yourPoints) {
    var TotalArray = 0;
    for (var i in classPoints) {TotalArray += classPoints[i]};
    var classavg = (TotalArray)/(classPoints.length);
    //return classavg;

    var classavgwithme = (TotalArray + yourPoints)/(classPoints.length+1);
    //return classavgwithme;

    if ((classavg < yourPoints) && (classavgwithme < yourPoints))
    {return "true"} else { return "false"};

    }