Skip to content

Commit

Permalink
until doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
amcdnl committed Apr 1, 2012
1 parent c5bcc48 commit d152d58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion util/string/string.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ steal('can/util',function() {
* @parent can.util * @parent can.util
* Escapes a string for insertion into html. * 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 ) { esc : function( content ) {
return ( "" + content ) return ( "" + content )
Expand Down
10 changes: 7 additions & 3 deletions util/util.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Returns if the object is an Array
Iterates through an array or object like Iterates through an array or object like
like [http://api.jquery.com/jQuery.each/ jQuery.each]. 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 // function called with
// index=0 value={prop: "val1"} // index=0 value={prop: "val1"}
// index=1 value={prop: "val2"} // index=1 value={prop: "val2"}
Expand All @@ -67,13 +68,16 @@ like [http://api.jquery.com/jQuery.each/ jQuery.each].
/** /**
@function can.extend @function can.extend
@parent can.util @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 = {}, var first = {},
second = {a: "b"}, second = {a: "b"},
thrid = {c: "d"}; thrid = {c: "d"};
can.extend(first, second, third); //-> first can.extend(first, second, third); //-> first
first //-> {a: "b",c : "d"} first //-> {a: "b",c : "d"}
second //-> {a: "b"} second //-> {a: "b"}
thrid //-> {c: "d"} thrid //-> {c: "d"}
Expand Down

0 comments on commit d152d58

Please sign in to comment.