Javascript 中的 toString()函数

首页 / JavaScript入门教程 / Javascript 中的 toString()函数

此方法返回表示指定对象的字符串。

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>

运行上面代码输出

链接:https://www.learnfk.comhttps://www.learnfk.com/javascript/string-tostring.html

来源:LearnFk无涯教程网

Apples are round, and Apples are Juicy.

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

微服务架构实战160讲 -〔杨波〕

深入剖析Kubernetes -〔张磊〕

黄勇的OKR实战笔记 -〔黄勇〕

设计模式之美 -〔王争〕

SRE实战手册 -〔赵成〕

Python自动化办公实战课 -〔尹会生〕

程序员的个人财富课 -〔王喆〕

自动化测试高手课 -〔柳胜〕

零基础GPT应用入门课 -〔林健(键盘)〕

好记忆不如烂笔头。留下您的足迹吧 :)