---
title: "Kartik Choudhary (@kart-c) | Hashnode"
description: "Web Developer | Frontend Developer. Read the latest articles by Kartik Choudhary on Hashnode."
url: "https://hashnode.com/@kart-c"
---

@kart-c

# Kartik Choudhary

@kart-c · India · Joined September 2021

Web Developer | Frontend Developer

## Comments

[Thank you for bringing this to my notice. I found a workaround for this bug. If there is a condition where you need to edit the content of the array, then you can do this. e.g. const cart = \[{name: 'headphones', price: 2000}\]; const newCart = cart.map(item => ({...item})); newCart\[0\].name = 'Expensive Boat'; console.log(cart); // \[{name: 'headphones', price: 2000}\] console.log(newCart); // \[{name: 'Expensive Boat', price: 2000}\]](https://hashnode.com/posts/pure-functions-in-javascript/622a08686810179d5b052327/comment/622e6766197586d5f925c8c0#reply-6235a1b1bef4c71aa6f0fd74)

Reply · Article · Mar 19, 2022 · [Pure Functions in Javascript](https://hashnode.com/posts/pure-functions-in-javascript/622a08686810179d5b052327)
