From 8d632ada0b114f908496df8e0fb4deaecb6245ba Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 24 Feb 2010 14:04:33 -0500 Subject: [PATCH] added documentation for _.mixin --- index.html | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 7afa8c91c..808756688 100644 --- a/index.html +++ b/index.html @@ -173,8 +173,8 @@
noConflict, identity, times, - breakLoop, uniqueId, - template + breakLoop, mixin, + uniqueId, template

@@ -982,6 +982,23 @@ _.each([1, 2, 3], function(num) { result; => 2 +

+ mixin_.mixin(object) +
+ Allows you to extend Underscore with your own utility functions. Pass + a hash of {name: function} definitions to have your functions + added to the Underscore object, as well as the OOP wrapper. +

+
+_.mixin({
+  capitalize : function(string) {
+    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
+  }
+});
+_("fabio").capitalize();
+=> "Fabio"
+
+

uniqueId_.uniqueId([prefix])