JS数据类型

  • 基本(值)类型:保存数据,基本数据类型在栈空间开辟内存

    • Number ----- 任意数值 -------- typeof

    • String ----- 任意字符串 ------ typeof

    • Boolean ---- true/false ----- typeof

    • undefined --- undefined ----- typeof/===   (表示定义了未赋值)

    • null -------- null ---------- ===     (表示定义了并且赋值为null)

  • 对象(引用)类型:保存数据地址,引用型数据在堆空间开辟内存

    • Object ----- typeof/instanceof

    • Array ------ instanceof

    • Function ---- typeof

穷则独善其身,达则兼济天下……
原文地址:https://www.cnblogs.com/hmy-666/p/14429688.html