[Programmers] 평균 구하기

이상혁·2023년 5월 11일
0

Programmers

목록 보기
2/18

문제 설명

정수를 담고 있는 배열 arr의 평균값을 return하는 함수, solution을 완성해보세요.

solution.js

function solution(arr) {
    return arr.reduce((acc, cur) => acc + cur) / arr.length;
}
profile
l22coder

0개의 댓글

Powered by GraphCDN, the GraphQL CDN