How make lodash _.replace all occurrence in a string?
You can also do
var text = "azertyazerty";
var result = _.replace(text, /az/g, "qu");
you have to use the RegExp with global option offered by lodash.
so just use
var text = "azertyazerty";
_.replace(text,new RegExp("az","g"),"qu")
to return quertyquerty