diff --git a/index.html b/index.html index 540843faf..0d698948a 100644 --- a/index.html +++ b/index.html @@ -108,7 +108,7 @@ - + @@ -117,7 +117,7 @@
Development Version (0.4.0)16kb, Uncompressed with Comments18kb, Uncompressed with Comments
Production Version (0.4.0)

-

Object-Oriented and Functional Styles

+

Object-Oriented and Functional Styles

You can use Underscore in either an object-oriented or a functional style, @@ -205,6 +205,12 @@ _(lyrics).chain() template

+

+ Chaining +
+ chain, get +

+

Collection Functions (Arrays or Objects)

@@ -817,6 +823,30 @@ _.template(list, {people : ['moe', 'curly', 'larry']}); => "<li>moe</li><li>curly</li><li>larry</li>" +

Chaining

+ +

+ chain_(obj).chain() +
+ Returns a wrapped object. Calling methods on this object will continue + to return wrapped objects until get is used. ( + A more realistic example.) +

+
+_({moe : false, curly : true}).chain().values().any().isEqual(true).get();
+=> true
+
+ +

+ get_(obj).get() +
+ Extracts the value of a wrapped object. +

+
+_([1, 2, 3]).get();
+=> [1, 2, 3]
+
+

Change Log