How to remove first and last element in an array?
For example:
var fruits = ["Banana", "Orange", "Apple", "Mango"];
Expected output array:
["Orange", "Apple"]
fruits.shift(); // Removes the first element from an array and returns only that element.
fruits.pop(); // Removes the last element from an array and returns only that element.