Here my array :
let model = ["xxx","xxx"];
I want to replace the second 'x' in the string of the second element of the array by 'o'.
I tried this :
let model = ["xxx", "xxx"];
console.log(model[1][2])
// -> output : x -> OK
model[1][2] = model[1][2].replace('x', 'o')
console.log(model);
// -> output : ["xxx", "xxx"] -> ???
I tried this too :
let model = ["xxx", "xxx"];
console.log(model[1][2])
// -> output : x
model[1][2] = 'o'
console.log(model);
// -> output : ["xxx", "xxx"]
Why is not working ? Thank you !