Question: 1/*******Problem 1 Simple Array Searching********** /*Fill in the following function declaration. The procedure you provide should be able to find and return the given target
1/*******Problem 1 Simple Array Searching********** /*Fill in the following function declaration. The procedure you provide should be able to find and return the given target in the array, if it exists, or null if it does not. You do not have to make any assumptions about the argument types. - If arr does not hold items of target's type, this should return null*/ function simpleSearch(target, arr){ for (item of arr) { if (item === target) { return arr.indexOf(item) } return nuli } + 1/Testing code, calls the function. + console.log(simpleSearch(5, (1,2,3,4, 5])) //
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
