DEV Community

Discussion on: Typical JavaScript interview exercises (explained)

Collapse
 
saeedafroozi profile image
saeed afroozi

deep copy this my approach!!!!
adding this line:
const hr=JSON.parse(JSON.stringify(heroes));
It's work fine