🔸나의 풀이
let numbers = [1, 2, 3, 4, 5];
let num1 = 1;
let num2 = 3;
let answer = [];
for (let i = num1; i <= num2; i++) {
answer.push(numbers[i])
}
console.log(answer)
🔸다른 풀이
function solution(numbers, num1, num2) {
return numbers.splice(num1, num2-num1+1);
}