[짧] 시리즈 : spread & rest
const arr = [3, 4, 5, 7, 9, 1, 8];
console.log(Math.max(...spread));
console.log(Math.max(...arr)); // 9
// Math.max()의 매개변수로는 0개 이상의 숫자가 필요하고 가장 큰수가 반환된다.
function sum(a, b, ...나머지) {
console.log(나머지)
return a + b
}
console.log(sum(10, 20, 30, 40, 50, 60, 70))
// [30, 40, 50, 60, 70] 나머지 값들
// 30 리턴값