Skip to content

Instantly share code, notes, and snippets.

@hendrasyp
Created August 30, 2018 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hendrasyp/fd916c83fc8f213ccf8821b18b3cb932 to your computer and use it in GitHub Desktop.
Save hendrasyp/fd916c83fc8f213ccf8821b18b3cb932 to your computer and use it in GitHub Desktop.
Find Index for IE Issue
// 1. Use object.some
var index = -1;
items.some(function(el, i) {
if (el.OBJECT_NAME == "search") {
index = i;
return true;
}
});
// 2. use underscore.js
var index = _.findIndex(objects, function(item){
return item.name == programName;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment