Hacker News new | ask | show | jobs
by ianjsikes 2018 days ago
The cheaty way is `let copy = JSON.parse(JSON.stringify(val))`. Doesn't work for functions or cyclic structures though.