Vaishak Kallore
Sep 5, 2018 · 1 min read
var arr = ['this', 'one', 'is', 'obvious']
var arr2 = Object.assign([], arr)
console.log(arr2)
(4) ["this", "one", "is", "obvious"]

In this post, you have pointed out an error,

// ERR Oh no! Did you try to put an array in me? I can only copy objects! -Object.assign()

I’ve tried in Chrome, was that due to version issue & _Object.assign_ has covered this already?

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade