(01)javascript 数据类型

来源:互联网 发布:网络代购英文怎么说 编辑:程序博客网 时间:2024/06/10 15:32
<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title></title>    <script type="text/javascript">        function f() {        }        var s = "";        s+="typeof true:\t\t\t"+typeof true+"\n"        s+="typeof 3.3:\t\t\t\t"+typeof 3+"\n"        s+="typeof 'hello':\t\t\t"+typeof 'hello'+"\n"        s+="typeof f :\t\t\t\t"+typeof f+"\n";        s+="typeof new Array(1,2,):\t"+typeof new Array(1,2)+"\n"        s+="typeof [1,3]:\t\t\t"+typeof [1,3]+"\n"        s+="typeof null:\t\t\t"+typeof null+"\n"        s+="typeof undefined:\t\t"+typeof undefined+"\n"        console.log(s)        /*结果如下:        typeof true:            boolean        typeof 3.3:             number        typeof 'hello':         string        typeof f :              function        typeof new Array(1,2,): object        typeof [1,3]:           object        typeof null:            object        typeof undefined:       undefined*/    </script></head><body></body></html>
0 0
原创粉丝点击