Commit Graph

260 Commits

Author SHA1 Message Date
Malcolm Locke
a8f0445192 Add an optional index argument to _.last()
This makes _.last() behave the same as _.first().  Passing an optional
second argument n will return the last n elements of the array.
2011-08-31 22:39:05 +12:00
Jeremy Ashkenas
03b341d063 Merging in #194, adding an iterator to _.uniq 2011-08-03 11:32:31 -04:00
Jeremy Ashkenas
39b07d7b2c Underscore.js 1.1.7 2011-07-13 17:02:12 -04:00
Jeremy Ashkenas
c1a556216e Revert "Edited underscore.js via GitHub"
This reverts commit 47fb3d7f9c.
2011-07-13 15:57:52 -04:00
Jeremy Ashkenas
a6cba6885e Revert "merging in faster indexOf patch ... arguably faster than the native implementation, but oh well. #245"
This reverts commit f099038a9d.
2011-07-13 15:57:42 -04:00
Jeremy Ashkenas
f099038a9d merging in faster indexOf patch ... arguably faster than the native implementation, but oh well. #245 2011-07-13 15:12:50 -04:00
limeblack
47fb3d7f9c Edited underscore.js via GitHub 2011-07-13 11:19:34 -07:00
Jeremy Ashkenas
19beb29283 Revert "Issue #103, change initial value detection for reduce()"
This reverts commit 174c897fce.
2011-07-13 12:57:51 -04:00
Jeremy Ashkenas
347d7297f3 function formatting. 2011-07-13 12:41:17 -04:00
Jeremy Ashkenas
779a28d59a Merge branch 'underscore.any' of https://github.com/shinuza/underscore 2011-07-13 12:40:08 -04:00
Jeremy Ashkenas
5edc3761c6 Issue #209, fix reduce without a memo for arrays that are sparse at the beginning. 2011-07-13 12:27:11 -04:00
Jeremy Ashkenas
174c897fce Issue #103, change initial value detection for reduce() 2011-07-13 12:21:08 -04:00
Jeremy Ashkenas
cd236d4c47 Issue #243. _.functions now also returns the names of function defined in the prototype chain. 2011-07-13 11:09:51 -04:00
Jeremy Ashkenas
727db393d5 Amending length check as discussed in 942d63 2011-07-12 17:01:04 -04:00
Jeremy Ashkenas
0ec859a142 Issue #225, adding _.union, _.difference, to complement _.without and _.intersection. 2011-07-12 16:48:30 -04:00
Jeremy Ashkenas
942d63129b Fixing silly commit. Thanks @cirwin 2011-07-12 15:27:42 -04:00
Jeremy Ashkenas
fbae682e8f fixing comment for #239 2011-07-12 15:23:23 -04:00
Jeremy Ashkenas
5eaf71f101 removing somewhat silly isNumber check. 2011-07-12 15:22:39 -04:00
Florian Friesdorf
0202f9f79b make toArray return a clone in case of an array
In combination with backbone this makes coll.toArray() return an array
instead of just returning coll.models, enabling
coll.remove(coll.toArray()) whithout failing half way through.
2011-06-21 18:31:40 +02:00
Dmitry Baranovskiy
42487bf47d Fixed isEqual if second object has isEqual implemented and added isObject method 2011-06-07 09:48:34 +10:00
shinuza
40af1652eb Modified any/some test case to demonstrate issue #177
Fixed any/some formatting to be consistent with the rest of underscore.js
2011-05-20 09:13:58 +02:00
Jeremy Ashkenas
bf6098f986 closure-compiler comment, plus semicolons. 2011-05-11 13:08:59 -04:00
Jeremy Ashkenas
379d177a7e Merge pull request #203 from ded/latest
set "_" extern for use with Closure Compilers ADVANCED_OPTIMIZATIONS
2011-05-11 10:06:45 -07:00
Jeremy Ashkenas
057da5bc82 Issue #202 ... fallback method for sparse arrays. 2011-05-11 10:27:52 -04:00
Dustin Diaz
72c5558471 set "_" extern for use with Closure Compilers ADVANCED_OPTIMIZATIONS 2011-05-10 23:09:26 -07:00
shinuza
5141a51298 Refactored fix as suggested in
https://github.com/documentcloud/underscore/issues/177
2011-05-07 16:29:43 +02:00
shinuza
6846d71f88 Fixing _.any returning an incorrect result when Array.prototype.some is
missing but Array.prototype.forEach exists.
2011-05-07 11:24:05 +02:00
Andrei
1681d25063 in groupBy, also pass index to iterator. 2011-05-05 14:43:28 -04:00
Andrei
b75e48c057 cleaned up key check in groupBy 2011-05-05 14:31:40 -04:00
Andrei
f8a4b78a86 Adding groupBy. 2011-05-05 14:00:40 -04:00
Alfredo Mesen
b9307163b9 Add optional iterator to _.uniq 2011-05-03 21:16:57 -06:00
Jeremy Ashkenas
b617615819 Underscore.js 1.1.6 2011-04-18 09:08:52 -04:00
Jeremy Ashkenas
6f25ccae31 michaelficarra's proposed tweak to _.after 2011-04-15 18:01:53 -04:00
Jeremy Ashkenas
ea44179d81 Issue #123. _.extend shouldn't copy keys for undefined values. 2011-04-15 17:46:16 -04:00
Jeremy Ashkenas
bf214d2c8d stricter ECMA5 compliance. _.every now requires an iterator to be passed. #160 2011-04-15 17:17:54 -04:00
Jeremy Ashkenas
3df562f07e tweaking invoke implementation 2011-04-15 17:00:37 -04:00
Jeremy Ashkenas
8f67aa3f18 _.barrier -> _.after, switch the order of arguments ... fix test formatting. 2011-04-15 16:17:58 -04:00
Sam Gentle
217a6a6a63 _.barrier + tests 2011-04-14 07:19:05 +10:00
Samuel Clay
1fc7d4b049 Revert "Adding _.count to count truthy values in an iterator. _.count([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }) = 3"
This reverts commit c8e3c04076.

Conflicts:

	underscore.js
2011-04-06 09:03:40 -04:00
Samuel Clay
5457522582 Speeding up a few methods which assign a default identity function for missing/optional iterators. Noticeable difference. 2011-04-05 18:11:20 -04:00
Samuel Clay
c8e3c04076 Adding _.count to count truthy values in an iterator. _.count([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }) = 3 2011-04-05 18:09:47 -04:00
aseemk
3f512c2495 Add support for _.invoke() to take function reference. 2011-03-25 12:35:11 -07:00
Jeremy Ashkenas
6d4b76705d we're reserving nativeBind ... we should be actually using it. 2011-03-22 15:48:09 -04:00
Jeremy Ashkenas
2498bccb50 changing order of operations to force an errror when _.bind -ing null or undefined values. 2011-03-22 10:44:07 -04:00
Jeremy Ashkenas
c5ba702542 Underscore.js 1.1.5 2011-03-20 20:20:08 -04:00
Jeremy Ashkenas
39119065dc Adding _.once ... Issue #121 2011-03-20 19:32:20 -04:00
Jeremy Ashkenas
52916aad87 Merge branch 'master' of https://github.com/TrevorBurnham/underscore 2011-03-20 19:26:52 -04:00
Kit Goncharov
48abcd84c5 Issue #149: _.keys should throw a TypeError for non-objects. 2011-03-20 10:08:32 -06:00
Kit Goncharov
4869b4c6ca Issue #150: _.bind should allow binding functions to falsy values. 2011-03-20 09:36:44 -06:00
Jeremy Ashkenas
513d322525 Merging in the native bind branch. 2011-02-28 10:54:12 -05:00