The answer might be obvious but I didn't find out. I have this code :
const arr = ["Hello"];
let currentStr = arr[0];
currentStr += " world";
console.log(currentStr); // prints "Hello world"
console.log(arr); // prints ["Hello"]
I just want to copy the string reference so when I change the currentStr value, it also change its reference in the array (here the first item of the arr array).
const arr = ["Hello"];
let currentStr = arr[0];
currentStr += " world";
console.log(currentStr); // prints "Hello world"
console.log(arr); // expect print ["Hello world"]
stringstogether - hence why the print[Hello]from the originalarrarr[0] += " world"did you try like this or you want entirely different things,?