This is like my least favorite named method in jquery. Each time I want to combine two objects, it takes me a few seconds to think about what he called. You can also use assign in Ember.
Ember.assign({first: 'Tom'}, {last: 'Dale'}); // {first: 'Tom', last: 'Dale'} var a = {first: 'Yehuda'}, b = {last: 'Katz'}; Ember.assign(a, b); // a == {first: 'Yehuda', last: 'Katz'}, b == {last: 'Katz'}
or in your case
Ember.assign({}, orig);
http://emberjs.com/api/classes/Ember.html#method_assign
But, you should note that it does not support deep cloning, as the copy does.
Kingpin2k
source share