How to remove first and last element in an array?
For example:
var fruits = [\"Banana\", \"Orange\", \"Apple\", \"Mango\"];
Expecte
To remove the first and last element of an array is by using the built-in method of an array i.e shift() and pop() the fruits.shift() get the first element of the array as "Banana" while fruits.pop() get the last element of the array as "Mango". so the remaining element of the array will be ["Orange", "Apple"]