Opened 14 years ago
Closed 14 years ago
#5000 closed feature (worksforme)
Add Join Object to Core
Reported by: | zRing | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | core | Version: | 1.3.2 |
Keywords: | join, objects, core | Cc: | |
Blocked by: | Blocking: |
Description
It would be cool if a function like:
function joinObjs() {
var newObj = {};
for(var i = 0;i < arguments.length; i++) {
if(typeof(arguments[i]) == "object") {
for(key in arguments[i]) {
newObj[key] = arguments[i][key];
}
}
}
return newObj;
}
was added to the core of jQuery. I find myself needing to join objects all the time, and it would be useful if it was added to jQuery.
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
comment:3 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Yeah, this sounds exactly like jQuery.extend. Check it out.
Note: See
TracTickets for help on using
tickets.
http://docs.jquery.com/Core/jQuery.extend#object