We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecbe1b2 commit c942abfCopy full SHA for c942abf
unn04012/array/cut_array.js
@@ -0,0 +1,9 @@
1
+function solution(numbers, num1, num2) {
2
+ const answer = [];
3
+
4
+ for (let i = num1; i <= num2; i++) answer.push(numbers[i]);
5
6
+ return answer;
7
+}
8
9
+console.log(solution([1, 2, 3, 4, 5], 1, 3));
0 commit comments