50
-20
0
array 1
5
-50
10
array 2
50
-20
0
Firstelement
Lastelement
Firstelement
Lastelement
5
-50
10
50
10
New Array :
Create a new array of length 2 from two arrays,which contain the first and last elements from the two arrays
Length 2
w3resource.com