Bug Tracker

Opened 15 years ago

Closed 15 years ago

#1830 closed enhancement (wontfix)


Reported by: Byron Owned by:
Priority: minor Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:


It would be nice to add a function which allows you to copy an object and all its properties, for those cases where you dont want $.extend to overwrite your original object.

$.extend($.copy(myObj), {foo : 'bar'});

Change History (1)

comment:1 Changed 15 years ago by brandon

Resolution: wontfix
Status: newclosed

This is better implemented in your own code base. It can be achieved with the following code.

$.copy = function(obj) {
    return $.extend({}, obj);
Note: See TracTickets for help on using tickets.