mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
getting ready for 0.1
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
// Underscore.js
|
||||
// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
|
||||
// Underscore is freely distributable under the terms of the MIT license.
|
||||
// Portions of Underscore are inspired by or borrowed from Prototype.js,
|
||||
// Oliver Steele's Functional, And John Resig's Micro-Templating.
|
||||
// For all details and documentation:
|
||||
// http://fdjklsafjsdalk
|
||||
// http://documentcloud.github.com/underscore/
|
||||
window._ = {
|
||||
|
||||
VERSION : '0.1.0',
|
||||
|
||||
|
||||
// The cornerstone, an each implementation.
|
||||
// Handles objects implementing forEach, _each, arrays, and raw objects.
|
||||
each : function(obj, iterator, context) {
|
||||
@@ -243,9 +245,9 @@ window._ = {
|
||||
// passed-in arrays.
|
||||
intersect : function(array) {
|
||||
var rest = _.toArray(arguments).slice(1);
|
||||
return _.select(_.uniq(array), function(item1) {
|
||||
return _.select(_.uniq(array), function(item) {
|
||||
return _.all(rest, function(other) {
|
||||
return _.detect(other, function(item2){ return item1 === item2; });
|
||||
return _.indexOf(other, item) >= 0;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user