{"size": 749, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "isleeden/typical-arrays-problems", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "isleeden/typical-arrays-problems", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "isleeden/typical-arrays-problems", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.0227272727, "max_line_length": 39, "alphanum_fraction": 0.4672897196}
exports.min = function min(array) {
    if (!array || array.length === 0) {
        return 0;
    }

    let minValue = array[0];

    array.forEach((item) => {
        if (minValue > item) {
            minValue = item;
        }
    });

    return minValue;
};

exports.max = function max(array) {
    if (!array || array.length === 0) {
        return 0;
    }

    let maxValue = array[0];

    array.forEach((item) => {
        if (maxValue < item) {
            maxValue = item;
        }
    });

    return maxValue;
};

exports.avg = function avg(array) {
    if (!array || array.length === 0) {
        return 0;
    }

    return (
        array.reduce((acc, item) => {
            return acc + item;
        }) / array.length
    );
};
