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

  • Object/Oriented JavaScript
  • Stoyan Stefanov
  • 128字
  • 2021-08-13 19:25:52

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
主站蜘蛛池模板: 张家界市| 嵊州市| 宾阳县| 尚志市| 翁牛特旗| 社旗县| 柏乡县| 江都市| 尤溪县| 遂宁市| 台北市| 涞源县| 永年县| 轮台县| 荣昌县| 上犹县| 万安县| 双鸭山市| 澜沧| 从化市| 松桃| 兰州市| 明溪县| 美姑县| 积石山| 高碑店市| 德保县| 牙克石市| 三门县| 聂荣县| 中西区| 永仁县| 藁城市| 辽宁省| 黑河市| 郑州市| 潞西市| 工布江达县| 西丰县| 苏州市| 屏南县|