String.toString() : toString « String « JavaScript Tutorial






If invoked on the core String object, will return the object type or the name of the constructor that created the object. This will be something like the following:

function String() { [native code] }

If it is invoked on an instance of the String object, it will contain the source string of the instance you created.

<html>
    <script language="JavaScript1.3">
    <!--
    var myString = new String("Hello, World!");

    document.write(myString.toString() + '<br>');

    document.write(String.toString());

    document.close();

    -->

    </script>
</html>








6.35.toString
6.35.1.String.toString()