Javescript变量定义及类型


<html>

    <head>
        <meta charset="UTF-8">
        <title>变量定义及类型title>
    head>

    <body>
        <script>
            //          定义变量的关键字
            //Javescript数据类型:undefined;number;string;boolean;object;null
            var x;
            alert(typeof(x));
            x = 1;
            x -= 8.3;
            alert(typeof(x));
            x = "hello";
            alert(typeof(x));
            x = true;
            x = false;
            alert(typeof(x));
            x = {};
            alert(typeof(x));
            x = null;
            alert(typeof(x));
        script>
    body>

html>

你可能感兴趣的:(Javescript)