zoukankan      html  css  js  c++  java
  • Javascript数据类型共有六种

    Javascript数据类型共有六种

    /*
    var box;
    alert(typeof box); // box是Undefined类型,值是undefined,类型返回的字符串是undefined
    
    var box = true;
    alert(typeof box); // box是Boolean类型,值是true,类型返回的字符串是boolean
    
    var box = 'a';
    alert(typeof box); // box是String类型,值是'a',类型返回的字符串是string
    
    var box = 123;
    alert(typeof box); // box是Number类型,值是123,类型返回的字符串是number
    
    var box = {};
    alert( box); // box是Object类型,值是[object Object],类型返回的字符串是object
    
    var box = null;
    alert( box); // box是Null类型,值是null,类型返回的字符串是object
    
    var box = new Object();
    alert( box); // box是Object类型,值是[object Object],类型返回的字符串是object
    
    共有以上六种数据类型;function不是数据类型;
    
    function box(){
    }
    alert(typeof box);// box是Function函数,值是function box(){},类型返回的字符串是function
    
    typeof可以直接写入自变量;
    alert(typeof nulla); // 这个返回undefined,但是nulla 是 is not defined
    
    */
    
    
    alert(typeof nulla);
  • 相关阅读:
    c++获取时间戳
    指针数组学习
    Matlab小波工具箱的使用2
    matlab 小波工具箱
    指针
    低通滤波参数
    git 合并分支到master
    matlab json文件解析 需要下载一个jsonlab-1.5
    matlab2017b
    数据结构-链式栈c++
  • 原文地址:https://www.cnblogs.com/stono/p/5568418.html
Copyright © 2011-2022 走看看