This does not work because of the variable rep. What is the correct syntax please?
var bigtext = 'testing test test test';
var rep = 'test';
bigtext = bigtext.replace(/rep/g, "MOO!");
I know the problem is with the regex part in the replace...but what is the correct way to write it?