Documentation for a historical release of Infusion: 1.4
Please view the Infusion Documentation site for the latest documentation, or the Infusion 1.3. Documentation for the previous release.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

fluid.copy

fluid.copy(tocopy)

Performs a deep copy (clone) of the object passed in the argument.

fluid.copy(tocopy);

File name: Fluid.js

Parameters

tocopy (Object) The object to be copied

Return Value

Object The copied object

See Also


Notes

This function recursively copies the contents of tocopy into a new object of the same type.

Example

var oldModel = fluid.copy(that.model);

In this example, fluid.copy() is being used to preserve a copy of a model. This can be useful for scenarios where some kind of 'revert' or 'undo' might be desirable.