clone
makes a shallow copy of an object
object clone(object source);
| source | object | the source (passed) object |
| object | the copy of the source object |
Example
var obj1 = {name:"flower", type:"rose", colors: ['red','pink','white','yellow'] }
var obj2 = webix.clone(obj1);
obj1.type = 'tulip';
obj1.type // -> 'tulip'
obj2.type // -> 'tulip'
obj2.colors // -> ['red'] Warning! It's a shallow copy
See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support,
connect with other developers, and share your feedback there.