zoukankan      html  css  js  c++  java
  • JS数据类型

    常见数据类型

    boolean; number; string; object; undefined

    代码示例

    常见数据类型
    
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script type="text/javascript">
            function f() {
    
            }
            var s = "";
            s+="typeof true:			"+typeof true+"
    "
            s+="typeof 3.3:				"+typeof 3+"
    "
            s+="typeof 'hello':			"+typeof 'hello'+"
    "
            s+="typeof f :				"+typeof f+"
    ";
            s+="typeof new Array(1,2,):	"+typeof new Array(1,2)+"
    "
            s+="typeof [1,3]:			"+typeof [1,3]+"
    "
            s+="typeof null:			"+typeof null+"
    "
            s+="typeof undefined:		"+typeof undefined+"
    "
            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>
    
    
    
    
  • 相关阅读:
    jquery文本折叠
    物理小词典
    程序员的十层楼
    各种语言的hello world
    读书遇到的一些概念
    银行业务一些概念
    mysql 基本操作
    oracle 基本操作
    maven 基本操作
    ubuntu JavaWeb环境搭建
  • 原文地址:https://www.cnblogs.com/yldf/p/9385384.html
Copyright © 2011-2022 走看看