slice

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Array/slice

const appList = [0,1,2,3,4,5]
appList.slice(3) // [3,4,5]
appList.slice(2,5); // [2,3,4]

const a = appList.slice(3)
a // [3,4,5]
appList // [0,1,2,3,4,5]

reduce

배열의 각 요소에 대해 주어진 리듀서(reducer) 함수를 실행하고, 하나의 결과값을 반환합니다.

const array1 = [1, 2, 3, 4];
const reducer = (accumulator, currentValue) => accumulator + currentValue;

// 1 + 2 + 3 + 4
console.log(array1.reduce(reducer));
// expected output: 10

// 5 + 1 + 2 + 3 + 4 초기값지정가능
console.log(array1.reduce(reducer, 5));
// expected output: 15

array1.reduce((accumulator, currentValue) => accumulator + currentValue, 3)