Slicing Strings

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

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

    // Create substring that is one from the end to five from the end
    var substring = string.slice(-5, -1);

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