How to replace all occurrences of string in JavaScript

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

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