๐ ๋ฐฐ์ด์์ ๊ฐ์ฒด ๊ฐ ๋ณ๊ฒฝํ๊ธฐ
let array = [
{number : [1,2,3]},{number : [2,3,4]},{number : [4,5,6]}
];
function x(array){
return array.map(x => {
const sum = x.number.reduce((a,b) => { return a+b }, 0);
const average = sum/x.number.length;
//return x.number = average;
//์ด๋ ๊ฒ ๋๋๋ฉด ๊ฒฐ๊ณผ [2,3,5];
x.number = average;
return x;
//์ด๋ ๊ฒ x ๊ทธ์์ฒด๋ฅผ ๋๋ ค์ฃผ์ด์ผํจ
//[{number:2},{number:3},{number:5}]
});
}