I have a string for example:
var string = \'This is a text that needs to change\';
And then I have two arrays.
var array1 =
Assuming your two arrays have the same size:
for(var i = 0; i < array1.length; i++){ mystr = mystr.replace(array1[i], array2[i]); }