Skip to main content

Bug Tracker

Side navigation

#1830 closed enhancement (wontfix)

Opened October 21, 2007 02:01AM UTC

Closed November 14, 2007 03:10AM UTC

$.copy

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

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'});
Attachments (0)
Change History (1)

Changed November 14, 2007 03:10AM UTC by brandon comment:1

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);
};