I have any array of objects like this
let myObj=[{a:'CR',showMe: true},{a:'PY'}];
Now I'm trying to find the object which has a as CR and showMe as true and want to change the a value.
let findObj = myObj.filter(i=> i.a == 'CR' && i.showMe);
findObj.map(ele => ele['a'] = "PS");
When I'm trying to console myObj,value
of a in myObj is changed along with findObj.
I don't want myObj to be changed.
What is causing the issue, could someone help?