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: 15357
6
posted
0
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
posted
0
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.