Javascript - Practice Questions
Javascript Practice Questions
1.2
Exercise

Return sum of first and last element of array

Finish the function definition below.

Given an array arr, the function sumExtremes() should return the sum of the first and the last element of arr.

Note: If arr does not contain any element, the function should return 0.