up.util.copy(object)
JavaScript function
Returns a shallow copy of the given value.
Copying protocol
- By default
up.util.copy()can copy array-like values, plain objects andDateinstances. - Array-like objects are copied into new arrays.
- Unsupported types of values are returned unchanged.
- To make the copying protocol work with user-defined class,
see
up.util.copy.key. - Immutable objects, like strings or numbers, do not need to be copied.
Parameters
object
required
Type: any
Return value
Type: any