Created
May 7, 2018 11:59
-
-
Save user24/005ceff7cec1338229ab4bd8a18a5112 to your computer and use it in GitHub Desktop.
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 searchArray = [1,2,3]; | |
var targetValue = 2; | |
// Not supported in MSIE | |
searchArray.find(function (val) { | |
return val === targetValue; | |
}); | |
// Supported in MSIE | |
searchArray.filter(function (val) { | |
return val === targetValue; | |
})[0]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment