Замените все Ocourrences в JS

let str = 'hotdog dog'.replace(new RegExp('dog','g'), 'cat');
console.log(str) //output: hotcat cat
Juan Gabriel