• + 0 comments

    Javascript

    function stdDev(arr) {
        const sum = arr.reduce((acc, cur) => acc + cur, 0);
        const mean = sum / arr.length;
        console.log(Math.sqrt([...arr].reduce((acc, curr) => acc + Math.pow(curr - mean, 2), 0) / arr.length).toFixed(1))
    }