此方法返回表示指定对象的字符串。
toString() - 语法
string.toString( )
toString() - 返回值
返回表示指定对象的字符串。
toString() - 示例
<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>
运行上面代码输出
Apples are round, and Apples are Juicy.