Skip to content

Commit 7cb7fb9

Browse files
IgorMinarmhevery
authored andcommitted
Add JSDoc for the copy() method
1 parent 0649009 commit 7cb7fb9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Angular.js

+15
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,21 @@ function isLeafNode (node) {
205205
return false;
206206
}
207207

208+
/**
209+
* Copies stuff.
210+
*
211+
* If destination is not provided and source is an object or an array, a copy is created & returned,
212+
* otherwise the source is returned.
213+
*
214+
* If destination is provided, all of its properties will be deleted and if source is an object or
215+
* an array, all of its members will be copied into the destination object. Finally the destination
216+
* is returned just for kicks.
217+
*
218+
* @param {*} source The source to be used during copy.
219+
* Can be any type including primitives, null and undefined.
220+
* @param {(Object|Array)=} destination Optional destination into which the source is copied
221+
* @return {*}
222+
*/
208223
function copy(source, destination){
209224
if (!destination) {
210225
if (source) {

0 commit comments

Comments
 (0)