官术网_书友最值得收藏!

Primitive data types recap

Let's quickly summarize some of the main points discussed so far:

  • There are five primitive data types in JavaScript:
    • Number
    • String
    • Boolean
    • Undefined
    • Null
  • Everything that is not a primitive data type is an object
  • The primitive number data type can store positive and negative integers or floats, hexadecimal numbers, octal numbers, exponents, and the special numbers NaN, Infinity, and –Infinity
  • The string data type contains characters in quotes
  • The only values of the Boolean data type are true and false
  • The only value of the null data type is the value null
  • The only value of the undefined data type is the value undefined
  • All values become true when converted to a Boolean, with the exception of the six falsy values:
    • ""
    • null
    • undefined
    • 0
    • NaN
    • false
主站蜘蛛池模板: 平潭县| 正阳县| 阿克| 灵寿县| 保亭| 盱眙县| 安多县| 楚雄市| 积石山| 方山县| 五峰| 和田县| 五大连池市| 瑞昌市| 名山县| 筠连县| 岑巩县| 阜平县| 大荔县| 炉霍县| 建阳市| 永济市| 工布江达县| 梁平县| 宝应县| 瓮安县| 长治县| 寿光市| 龙游县| 临夏县| 涪陵区| 江孜县| 松溪县| 开原市| 怀来县| 丹巴县| 精河县| 阆中市| 馆陶县| 吉林省| 临夏县|