Javascript Object deep copy one-liner
Is this code efficient?


Probably... not.

Efficiency can mean different things. Efficiency could mean "fast running code" or "use the least amount of memory" - this can only be determined by running the code through a profiler. Efficiency could also mean "I can use it easily" or "works reliably" or "handles edge cases well" - this can only be determined by having other people use it.


  Are there any reasons this shouldn't be used in the wild?


Yes.

Does the code really run on a variety of objects? What if I put things like Arrays, Dates, RegExps, Maps, Sets, etc. in my object? Does it handle circular references? This is a naive implementation of deep-copy which is fine in small apps and prototypes where you know what the data looks like. But in more general cases, this will probably not hold.

If you'd like to see how a general-purpose deep-copy function looks like, see how jQuery.extend or lodash.assign is implemented.


  Is there a way I can make it shorter?


Wrong question. Code size is irrelevant in JS, you have minifiers for that.