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

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
主站蜘蛛池模板: 彭阳县| 临清市| 托克逊县| 松溪县| 昔阳县| 尉犁县| 凌云县| 大连市| 江达县| 伊川县| 泸州市| 滁州市| 万源市| 萝北县| 新野县| 三亚市| 阿克陶县| 桂平市| 金堂县| 乌鲁木齐市| 江门市| 八宿县| 福贡县| 达拉特旗| 长宁区| 崇阳县| 阳谷县| 滨州市| 黄山市| 土默特右旗| 舟山市| 宁化县| 稻城县| 延川县| 北京市| 云阳县| 莲花县| 新闻| 枝江市| 健康| 扎兰屯市|