码迷,mamicode.com
首页 > 编程语言 > 详细

javascript String

时间:2017-04-10 21:15:16      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:write   har   lan   大小   asc   text   xmlns   运算符   比较   

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>

     <script type="text/javascript">
     var str1= new String("hello");
     var str2 =new String("hello");
     document.write("yiyangma?"+(str1.toString()==str2.toString()));

     </script>

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


</head>
<body>
    
</body>
</html>

 

javascript

 区分大小写

与 Java 一样,变量、函数名、运算符以及其他一切东西都是区分大小写的。

比如:

变量 test 与变量 TEST 是不同的。

string  tostring 方法  比较内容是否相等 ;   ==面对new创建出来的,比较的是内存地址。

 

javascript String

标签:write   har   lan   大小   asc   text   xmlns   运算符   比较   

原文地址:http://www.cnblogs.com/yimian/p/6690875.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!