Given the function call
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
, I am trying to retrieve the last 2, 3
part after the initial array. However, I am unsure about how to achieve this.
When I use return arr[6];
or return arr[1][0]
, both statements do not return the expected output of 2
or 2, 3
(last two numbers).
I attempted to find a solution by researching Property Accessors, but it seems like I was looking in the wrong place for the answer.
Below is my current code:
function destroyer(arr) {
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Instead of obtaining the complete array [1, 2, 3, 1, 2, 3]
, my goal is to extract the elements following the array:
[1, 2, 3, 1, 2, 3], 2, 3