JavaScript String toString()方法 描述 该方法返回一个表示指定对象的字符串。 语法 其语法如下所示− string.toString() JavaScriptCopy 返回值 返回一个表示指定对象的字符串。 示例 尝试下面的示例。 <html> <head> <title>JavaScript String toString() Method</title> </head> <body> <script type = "text/javascript"> var str = "Apples are round, and Apples are Juicy."; document.write(str.toString( )); </script> </body> </html> JavaScriptCopy 输出 Apples are round, and Apples are Juicy. JavaScriptCopy