clone
clone copied to clipboard
ES5 property attributes are not preserved
Consider the following example:
var o = {};
Object.defineProperty(o, 'foo', {enumerable:true, writable:false, value:'f'});
var o2 = clone(o);
console.log(Object.getOwnPropertyDescriptor(o2, 'foo'));
The property descriptor on the copied object specifies the property as writable
even though the original property wasn't writable.