substring() in JavaScript

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

    var mySubString = myString.substring(0,10);
    document.write('The first 10 characters of our string, ' + myString);
    document.write(', are: ' + mySubString);
    document.close();
    -->
    </script>