fluid.copy(tocopy) Section |
---|
Column |
---|
| Performs a deep copy (clone) of the object passed in the argument. Code Block |
---|
| javascript |
---|
| javascript |
---|
bgColor | white |
---|
borderStyle | nonejavascript |
---|
|
fluid.copy(tocopy);
|
File name: Fluid.js Parameters Span |
---|
| tocopy
| (Object) The object to be copied |
|
Return Value |
| NotesThis function recursively copies the contents of tocopy into a new object of the same type. Example Code Block |
---|
|
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. |