55 I know, I just couldn't resist to post some more codes54 The thing is, I completely made it up![]()
57 I particularly like the 9 year cake episode56 so many things that crash this game https://www.youtube.com/playlist?list=PL1B_rbTOEyI9SDv4UGyA4j9DEVxfQ3Lbe
JSON.stringify() takes an object and turns it into a text representation of said object.55 How do you mean?
- What does it do?
- Why is it bad?
- Why is it the only good option?
- What are you trying to do?
let inputData = this.inputFieldData;
58 I need to make some changes to the object, while also keeping the original around. Does that make more sense?57 That's a bit paradoxical: "make changes without editing."
59 the thing is, I need this whole object but I need to edit all the names. And all other ways I know off aren't a deep copy.58 No copy constructor on it?
//make a deep clone
let inputData = JSON.parse(JSON.stringify(this.inputFieldData));
if(inputData.baseName){
inputData.inputs.forEach(
(value,key)=>{
inputData.inputs[key].input.name =
this.inputFieldData.baseName+
"["+this.inputCount+"]"+
value.input.name;
inputData.inputs[key].input.cssClass =
this.inputClass +
" "+
(inputData.inputs[key].input.cssClass || "") ;
}
)
delete inputData.baseName,
}