Replacing Strings

<p id="output"></p>

<script>
    // Create a string
    var string = "The army will attack at dawn! Go army!";

    // Create new string that replaces ALL (i.e. globally) instances of 'army' with 'navy'
    var newString = string.replace(/army/g, "Navy");

    // Insert the position inside the HTML element with ID="output"
    document.getElementById("output").innerHTML = newString;
</script>