Skip to content

Instantly share code, notes, and snippets.

@eto4detak
Created October 9, 2018 14:30
Show Gist options
  • Save eto4detak/d9cced84233bbfef912f4d45f5ca36c3 to your computer and use it in GitHub Desktop.
Save eto4detak/d9cced84233bbfef912f4d45f5ca36c3 to your computer and use it in GitHub Desktop.
js find array obj
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