Swap Two Elements in an Array

You have an array of fruit. Swap the first and last elements of the array so that the array begins with 'pear' and ends with 'apple'.
JavaScript
Console