Get a value from Array by index
Given an array and an index value, return a value from the array based on the given index value.
Sample Code:
function indexEle(arr,i) {
// Enter your logic here...
}
Examples:
Input: [1,2,3],1
Output: 2
Explanation: The index of the first element is 0.
Input: [1,2,3],2
Output: 3
Explanation: The index of the first element is 0.