Function

copy (obj, deep) Object public deprecated

Module: @ember/object
import { copy } from '@ember/object/internals';
obj
Object
The object to clone
deep
Boolean
If true, a deep copy of the object is made.
returns
Object
The copied object

Creates a shallow copy of the passed object. A deep copy of the object is returned if the optional deep argument is true.

If the passed object implements the Copyable interface, then this function will delegate to the object's copy() method and return the result. See Copyable for further details.

For primitive values (which are immutable in JavaScript), the passed object is simply returned.

© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/functions/@ember%2Fobject%2Finternals/copy