loading...

re: What’s your alternative solution? Challenge #53 VIEW POST

FULL DISCUSSION
 

Probably the easiest way:

const copy = src => JSON.parse(JSON.stringify(src))

Alternatively:

const copy = ar => [...ar.map(a => (Array.isArray(a) ? copy(a) : a))]
code of conduct - report abuse