Commit Graph

30 Commits

Author SHA1 Message Date
Aseem Kishore
de50fc4607 Add test case for invoke w/ function reference. 2011-03-25 12:06:10 -07:00
Jeremy Ashkenas
d2d6cfe667 Rework of #68, to use a flag to indexOf, instead of a separate function. 2010-12-17 10:57:12 -05:00
Jeremy Ashkenas
8c2570b0ba Issue #68. Adding _.sortedIndexOf 2010-12-17 10:35:53 -05:00
Ryan W Tenney
cdcf18b79c Improve compliance with Array methods in ES5 when passed a null value. (ES5 Array methods treat null like []) 2010-12-06 23:36:54 -05:00
Jeremy Ashkenas
2d06e1d526 Issue #70 -- implementing each, find, all, any, etc. without the use of a try/catch/throw. Minor speedup + avoids destroying the stack trace. 2010-12-01 11:08:34 -05:00
Jeremy Ashkenas
a08c3dbd6b Merge branch 'fix_reduceRight_initial_value' of http://github.com/mcmire/underscore 2010-11-01 08:42:19 -04:00
Elliot Winkler
f729769d85 Fix reduceRight() so that if you don't pass in an initial value, the last item in the collection is used 2010-10-31 19:03:52 -06:00
Elliot Winkler
c21e7b24c6 Fix reduce() so that if you don't pass in an initial value, the first item in the collection is used 2010-10-31 18:51:30 -06:00
Jeremy Ashkenas
74d282ccc8 fixing mistakenly-aliased contains ... should refer to include. 2010-10-15 17:15:26 -04:00
Jeremy Ashkenas
ef396a9e13 Aliasing _.contains to _.include 2010-07-15 10:18:11 -04:00
Jeremy Ashkenas
9827f87611 (breaking change) moving _.reduce's method signature to that of ECMA5. _.reduce(obj, iterator, memo). Updated tests and docs. 2010-07-15 09:50:55 -04:00
Jeremy Ashkenas
d7acbca2ce reverted _.buildLookup, restoring _.without to it's previous implementation, adding a test for object identity 2010-02-24 12:53:35 -05:00
Mike Frawley
263b1ee92d add #buildLookup method to turn collection in to a fast lookup hash
implement #without in terms of it
add tests and internal docs
2010-02-17 10:12:22 -06:00
Jeremy Ashkenas
5b5ee87c7a Underscore 0.5.8, with collection functions that once again work on NodeLists and HTMLCollections 2010-01-28 00:55:41 -05:00
Jeremy Ashkenas
5c314d206e adding an isArguments checker and enabling iteration (using each) over JS object hashes that have numeric length properties 2009-12-09 13:41:19 -05:00
Jeremy Ashkenas
3eb9c28039 Underscore shouldn't be able to iterate over the letters of a string cross-browser -- indexing into a string isn't supported in IE 2009-12-08 17:31:01 -05:00
Kirill Ishanov
451d9c5d62 implemented 6 more passing tests for range. Now works like python's range 2009-12-01 02:10:56 +03:00
Kirill Ishanov
d8cf99ba89 initial implementation of _.range 2009-12-01 00:44:13 +03:00
Jeremy Ashkenas
80939448a7 fixing broken _.breakLoop test -- implementation was fine, test was out of date. 2009-11-12 21:31:03 -05:00
Jeremy Ashkenas
4f0afda61c adding OO-style object wrapping (thanks macournoyer) -- now you can to _(array).each(); 2009-11-07 12:39:59 -05:00
Jeremy Ashkenas
cb38c6ae63 adding a reduceRight (it's in JS 1.8), and aliasing foldl and foldr 2009-10-30 09:40:19 -04:00
Jeremy Ashkenas
42637b5880 Issue #2 -- each now calls iterator with (value, key, list) when iterating over javascript objects 2009-10-29 10:46:53 -04:00
Jeremy Ashkenas
8e7b8d2dea started passing in the collection as the third argument to _.each iterators (Issue #1) 2009-10-29 10:26:16 -04:00
Jeremy Ashkenas
a82a01ebfc elaborate underscore initialization so that it works seamlessly on CommonJS, as well as in the browser 2009-10-28 23:53:40 -04:00
Jeremy Ashkenas
4f783846de merged in kriskowal's CommonJS branch and Dmitry Baranovskiy's optimizations 2009-10-28 23:21:24 -04:00
Jeremy Ashkenas
4a83fcdd26 version 0.2.0 is out, with inject -> reduce, JS standard methodname aliases, a compose(), and a lastIndexOf() 2009-10-28 18:49:50 -04:00
Jeremy Ashkenas
25d3177bd7 further along with the HTML documentation 2009-10-26 21:11:19 -04:00
Jeremy Ashkenas
d229e822e7 added an _.zip() 2009-10-26 09:15:14 -04:00
Jeremy Ashkenas
cf61edffa8 merged some tests 2009-10-26 08:43:10 -04:00
Jeremy Ashkenas
5c46c60b06 finished off the complete test suite for underscore -- let's polish off the corners and provide some docs 2009-10-26 08:40:14 -04:00