aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Problem understanding this code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem understanding this code" Watch "Problem understanding this code" New topic
Author

Problem understanding this code

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Hi i m currently going over an open source JS library and I am trying to comprehend it. I ran into something like this I deleted a lot of stuff in this code but i wanted to know what the extend method does , I believe its suppose to copy the properties of second into the first but whats after that ?? the extend function is not missing anything else. What does it do after copying the properties. IT neither returns the value and neither are the objects passed to this function global.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6


Since objects are passed by reference, you can not just store the values, you need to loop through them to make a copy.



Eric




Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Eric Pascarello wrote:

Since objects are passed by reference, you can not just store the values, you need to loop through them to make a copy.



Eric


Thanks Eric for clarifying that out. It helped a lot.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem understanding this code