Re: [jQuery] Use $.extend to clone object

2006-09-27 Thread Michael Geary
From: Klaus Hartl is it possible to use $.extend to clone an object? var template = { ... }; clone = $.extend({}, template); To answer my question, yes it works :-) Keep in mind that extend() does a shallow copy, not a deep copy. var one = { a:1, b:{ c:2 } }; var two =

Re: [jQuery] Use $.extend to clone object

2006-09-27 Thread Klaus Hartl
Michael Geary schrieb: From: Klaus Hartl is it possible to use $.extend to clone an object? var template = { ... }; clone = $.extend({}, template); To answer my question, yes it works :-) Keep in mind that extend() does a shallow copy, not a deep copy. var one = { a:1, b:{ c:2 }