Return specific element of an Array
GIven an array and integer, return a certain element from the array based on the integer.
Sample Code:
function getEle(arr,int) {
// Enter your logic here...
}
Examples:
Input: ['Jan','Feb','Mar','Apr','May'],3
Output: 'Mar'
Explanation: String 'Mar' is located in position 3 in the array
Input: [{id:1},{id:2},{id:3}],1
Output: {id:1}
Explanation: Object {id:1} is located in position 1 in the array