数据类型

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>js1-1</title>
        <script>
            // 尽量避免浮点数运算
            // console.log((1/3) == (1-2/3))
            var arr = [1,2,3,'hello',null,true];
            // 属性之间用,隔开
            var person = {
                name:"zxs",
                age:21,
                class:21.12
            }
            new Array(1,12,3,33,5,'hello');
        </script>
       
    </head>
    <!-- 数组是[],对象是{} -->
    <!-- java的数组必须列相同类型的对象,js不需要 -->
    <!-- null(空) 和 undefined(未定义) -->
    <body>

    </body>
</html>
posted @ 2023-03-28 10:13  小小的羊  阅读(13)  评论(0)    收藏  举报