Browse files

until doc updates

  • Loading branch information...
1 parent c5bcc48 commit d152d58ba10ba117168510fa6138d4d9938b0b7d @amcdnl amcdnl committed Apr 1, 2012
Showing with 8 additions and 4 deletions.
  1. +1 −1 util/string/string.js
  2. +7 −3 util/util.js
View
2 util/string/string.js
@@ -36,7 +36,7 @@ steal('can/util',function() {
* @parent can.util
* Escapes a string for insertion into html.
*
- * can.esc( "<foo>&<bar>" ) //-> "&lt;foo&lt;&amp;&lt;bar&lt;"
+ * can.esc( "<foo>&<bar>" ) //-> "&lt;foo&lt;&amp;&lt;bar&lt;"
*/
esc : function( content ) {
return ( "" + content )
View
10 util/util.js
@@ -54,7 +54,8 @@ Returns if the object is an Array
Iterates through an array or object like
like [http://api.jquery.com/jQuery.each/ jQuery.each].
- can.each([{prop: "val1"}, {prop: "val2"}], function( index, value ) {
+ can.each([{prop: "val1"}, {prop: "val2"}],
+ function( index, value ) {
// function called with
// index=0 value={prop: "val1"}
// index=1 value={prop: "val2"}
@@ -67,13 +68,16 @@ like [http://api.jquery.com/jQuery.each/ jQuery.each].
/**
@function can.extend
@parent can.util
-Extends an object like
-like [http://api.jquery.com/jQuery.extend/ jQuery.extend].
+
+`can.extend(target, objectN)` merges the contents of two or more objects together into the first object
+similarly to [http://api.jquery.com/jQuery.extend/ jQuery.extend].
var first = {},
second = {a: "b"},
thrid = {c: "d"};
+
can.extend(first, second, third); //-> first
+
first //-> {a: "b",c : "d"}
second //-> {a: "b"}
thrid //-> {c: "d"}

0 comments on commit d152d58

Please sign in to comment.