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);
  • 相关阅读:
    js 获得多个同name 的input输入框的值
    推荐系统
    异常检测
    降维——PCA主成分分析
    无监督学习——降维
    无监督学习——K-means聚类
    支持向量机——内核
    支持向量机背后的数学
    支持向量机——Large Margin Classifier
    支持向量机
  • 原文地址:https://www.cnblogs.com/stono/p/5568418.html
Copyright © 2011-2022 走看看