Skip to content

Instantly share code, notes, and snippets.

@terinjokes
Last active December 25, 2015 15:49
Show Gist options
  • Save terinjokes/7000980 to your computer and use it in GitHub Desktop.
Save terinjokes/7000980 to your computer and use it in GitHub Desktop.
/**
* @license
* Based on Lo-Dash 2.2.1 <http://lodash.com/>
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*
* Available under MIT license <http://lodash.com/license>
*/
jQuery.fn.some = function(callback) {
var index = -1,
length = this.length,
result;
while (++index < length) {
if ((result = callback(index, this[index]))) {
break;
}
}
return !!result;
};
/**
* @license
* Based on Lo-Dash 2.2.1 <http://lodash.com/>
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.5.2
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*
* Available under MIT license <http://lodash.com/license>
*/
jQuery.some = function(array, callback) {
var index = -1,
length = array.length,
result;
while (++index < length) {
if ((result = callback(index, array[index]))) {
break;
}
}
return !!result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment