Arrays • Exercise 1/6

First and Last

00:00
0
10 points

Instructions

Create a function first_and_last that takes an array and returns
a new array containing only the first and last elements.

Example: first_and_last([1, 2, 3, 4]) returns [1, 4]

Your Code

Results

Click "Run Tests" to see results