实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
    <title>String Type Example</title>
5
    <script type="text/javascript">
6
    
7
        var stringObject = new String("hello world");
8
        var stringValue = "hello world";
9
        
10
        alert(typeof stringObject);   //"object"
11
        alert(typeof stringValue);    //"string"
12
        alert(stringObject instanceof String);  //true
13
        alert(stringValue instanceof String);   //false
14
        
15
    </script>
16
</head>
17
<body>
18
19
</body>
20
</html>