I've looked across the forum but couldn't find a solution to my question.
I'd like to perform a pretty straightforward replace(). However, where I get stuck is that I want to replace Microsoft with W3Schools n times, based on a variable value that I'll be adding to the JS script (let's call it 'var').
var str = "Visit Microsoft!";
var res = str.replace("Microsoft", "W3Schools");
Does anyone know how to set that up?