pvorb/clone

clone(obj) removes property "Id"

Closed this issue · 2 comments

given this object:
var x = {
"Desc" : "Lorem ipsum dolor...",
"Features" : [],
"Id" : "WC"
};

if you were to do:
var y = clone(x);
console.log(y);

you would get:
{
"Desc" : "Lorem ipsum dolor...",
"Features" : []
}

pvorb commented
$ node                                                  
>  var clone = require('clone');                        
undefined                                               
> var x = {
... "Desc" : "Lorem ipsum dolor...",
... "Features" : [],
... "Id" : "WC"
... };
undefined
> var y = clone(x);
undefined
> console.log(y);
{ Desc: 'Lorem ipsum dolor...', Features: [], Id: 'WC' }
undefined

is what I get on the REPL.

Sorry, I closed it (not knowing how to delete) because though I saw this happening it turned out to be a problem with the Chrome console