Last active
November 21, 2016 13:08
-
-
Save vcostin/ce4608c5de03bf12e618218487c2b916 to your computer and use it in GitHub Desktop.
arrayIndexSearch
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
var getIndex = function(arr, verify) { | |
for (var i = 0; i < arr.length; i++) { | |
if (verify(arr[i])) { | |
return i; | |
} | |
} | |
return -1; | |
}; | |
//var index = getIndex(notesCache.items, function (element) { | |
// return element.id === data.id; | |
//}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment