In the code below an array of several numbers is given to the search() function. Change it so that the function returns the index of the element that equals 42, starting from the third element.
Array searching
Searching for an index
Report a typo
Sample Input 1:
2 42 4 6 42 8Sample Output 1:
4Write a program in JavaScript
function search(numbers) {
// Write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.