Write a JavaScript function that takes two parameters: an array and an integer n. The function should return the element at the nth index of the array?
Login to Submit
Input: [8,9,9,9,8,8,9,9,8,8,8,8] Output: 9 Input: 3 Output: 8 Input: 4 Output: 9