There’s a lot of hubub about “cloning” JavaScript objects. However, as I understand it, it’s a simple matter:
function clone(obj) {
return obj;
}
Now I realize that DOM objects aren’t cloned this way, but as I understand it the DOM is part of the browser, not part of JavaScript.
What objects require deep-cloning and why?
That just returns a reference to the exact same object. It doesn’t clone anything.
result is
true