Extract the first element of an Array
Given an array, return the very first element.
Sample Code:
function firstEle(arr) {
// Enter your logic here...
}
Examples:
Input: [1,2,3,4]
Output: 1
Explanation: Element 1 has an index value of zero.
Input: [[1,2],[3,4]]
Output: [1,2]
Explanation: Element [1,2] has an index value of zero.