Created
May 29, 2022 14:31
-
-
Save jsmanifest/300e76c8ce7e6f84b11af2c9b96be11b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 findValue(arr, callback) { | |
for (let index = 0; index < arr.length; index++) { | |
const value = arr[index] | |
if (callback(value)) { | |
return value | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment