How to replace all occurrences of string in JavaScript

Strings
Last updated Dec 16, 2017
const text = "We are outside. We are waiting.";

text.replace(/We/g, "You");
You are outside. You are waiting.