Skip to content

Instantly share code, notes, and snippets.

@mojaray2k
Created August 2, 2014 16:08
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 mojaray2k/a9b378c8c75b010f9877 to your computer and use it in GitHub Desktop.
Save mojaray2k/a9b378c8c75b010f9877 to your computer and use it in GitHub Desktop.
Array.prototype.some() is supported in IE9+, and there is a polyfill shown on https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some
var a = [1, 3, 5, 7, 9],
b = [1, 3, 4, 8, 9];
console.log(a.some(function (c) {
return c % 2 === 0; // false
}));
console.log(b.some(function (c) {
return c % 2 === 0; // true
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment