Created
October 9, 2018 14:30
-
-
Save eto4detak/d9cced84233bbfef912f4d45f5ca36c3 to your computer and use it in GitHub Desktop.
js find array obj
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
var indexOf = function (arr, id) { | |
for(var idx = 0, l = arr.length;arr[idx] && arr[idx].title !== id;idx++); | |
return idx === l ? -1 : idx; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment