Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Wiki Markup

h1. fluid.copy(tocopy)
Performs a deep copy (clone) of the object passed in the argument.
*File name:* {{Fluid.js}}

h2. Parameters

|*{{tocopy}}*| (Object) The object to be copied |

h2. Return Value
|*Object*| The copied object |



h3. See Also

h3. Notes

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

h3. 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.