Hacker News new | past | comments | ask | show | jobs | submit login

The cheaty way is `let copy = JSON.parse(JSON.stringify(val))`. Doesn't work for functions or cyclic structures though.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: