I am currently learning JavaScript and wanted to fellow coders to review a function that I had written. I am looking for feedback particularly on:Whether I have followed best practice and JavaScript conventionsAny suggestion on doing it better.Things I know I need to implement but don't know how:Validate if array values are numbersPurpose of function: Return all scores above a certain threshold. Function accepts two arguments. First is an array of scores and second argument is the threshold.My code:UPDATED code after putting it through JS lint - I have ignored some erros like moving vars in the loops to the top or not declaring vars in the for loop etc (before JSLint code is here http://jsbin.com/UtOMAyU/1/)function scoresAbove(scoresArg, thresholdArg) {    use strict;    var output = [],        nums = scoresArg,        threshold = thresholdArg;    //check if scores Arg provided is an array    if (typeof nums !== object || !nums.hasOwnProperty('length')) {        return Error: Number(s) not in the expected format. Please provid number(s) in an array format;    }else if (typeof threshold !== number) { //check if threshold Arg provided is an array        return Error: Threshold number not in the expected format. Please provid a threshold;    }    for (var i = 0, len = nums.length; i < len; i++) {        var currentNum = nums[i];        if (currentNum > threshold) {            output.push(currentNum);        }    }    //What to return from func    if (output == ) {        return No scores were above the  +  threshold you set as  + threshold;    }    return The following scores were above the threshold:  + output.join(, );}
Refactoring a function to return all scores above a certain threshold
javascript