substr() in JavaScript

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

    var mySubString = myString.substr(0,6);

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

    -->
    </script>