Created
August 30, 2018 05:01
-
-
Save hendrasyp/fd916c83fc8f213ccf8821b18b3cb932 to your computer and use it in GitHub Desktop.
Find Index for IE Issue
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
// 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