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

Primitive Data Types Recap

Let's quickly summarize what has been discussed so far:

  • There are five primitive data types in JavaScript:
    • number
    • string
    • boolean
    • undefined
    • null
  • Everything that is not a primitive is an object
  • The 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
主站蜘蛛池模板: 萝北县| 长海县| 沐川县| 临江市| 江津市| 阿合奇县| 海阳市| 金坛市| 天祝| 称多县| 黄冈市| 林州市| 刚察县| 呼伦贝尔市| 太白县| 嘉禾县| 凌源市| 荆门市| 湾仔区| 青田县| 长丰县| 苍南县| 白银市| 额尔古纳市| 特克斯县| 大新县| 霍州市| 凤城市| 江油市| 汉沽区| 永城市| 南华县| 定襄县| 山东| 华安县| 满城县| 磴口县| 滕州市| 锡林郭勒盟| 石棉县| 调兵山市|