如何去点标点符号?直接显示我爱你

来源:7-20 颠倒数组元素顺序reverse()

嘿大宝

2018-08-14 08:53

<!DOCTYPE html>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Array对象 </title>

<script type="text/javascript">

   var myarr1= ["我","爱","你"];

   document.write(myarr1+"<br/>");

   document.write(myarr1.reverse());

</script>

</head>

<body>

</body>

</html>


写回答 关注

3回答

  • mukewzh
    2018-08-14 09:29:09
    已采纳

    myarr1.join("");   双引号之间不要加东西就行

  • 夏析
    2018-08-31 16:44:25

    (myarr1.reverse().join(""));

  • 小吕123
    2018-08-27 14:00:01

    <!DOCTYPE html>

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Array对象 </title>

    <script type="text/javascript">

       var myarr1= ["我","爱","你"];

       document.write(myarr1+'<br/>');

        document.write(myarr1.join("")+'<br/>');

       document.write(myarr1.reverse().join(""));

    </script>

    </head>

    <body>

    </body>

    </html>


JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

468195 学习 · 21891 问题

查看课程

相似问题