slice() in JavaScript

<script language="JavaScript">
    <!--
    var myString = new String("This is a test");

    var mySlice = myString.slice(0,6);

    document.write('The first 7 characters of our string, ' + myString);
    document.write(', are: ' + mySlice);
    document.close();

    -->
    </script>