duplicate
Objective(s): Practice accessing the first and last elements of an array using their index.
Given an array, arr
, duplicate the first element to the last position. Assume the array is at least 1 in length. In other words, make the last element the same as the first element. For the problem, you need to use the length property of an array since you do not know how long the array is hence you cannot hardcode the last index.
What is the return type for this method? What does that mean when it comes to needing or not needing a return line?!
Type your solution
Skills Practiced:
3.C
3.D
4.A
4.B
Saved
Saved