This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
 
Similar Threads
Inconsistent behaviour by Spring Quartz Scheduler.
Can somebody tell me the code difference?
JavaScript Image properties not immediately available?
Changing the value of a commandlink
JavaScript code works in firefox but not in IE8