I know that this has been asked many times before, but I am a complete beginner to JS and did not understand any of the answers, and they did not seem to work when I attempted to run said solutions. I would like to know how to replace a part of a string with a variable, or potentially another string.
So if my code looks like this:
var text = "Eam dicit fuisset volumus an, usu ea tibique consulatu scribentur.";
var otherString = "Random text";
…how can I replace the text.substring[9, 20] with otherString, for instance.
Please explain as much as you can.
We are setting text, to the replaced text. I’m not sure what else to say.