Created
February 27, 2021 04:58
-
-
Save eengineergz/e98354b287ce2f80da4ab943399eb555 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function search(array, term) { | |
for (let i = 0; i < array.length; i++) { | |
if (array[i] === term) { | |
return i; | |
} | |
} | |
return -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment