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

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
主站蜘蛛池模板: 西城区| 泾源县| 崇文区| 贵州省| 凌海市| 永定县| 东兰县| 都兰县| 长葛市| 和平县| 阳新县| 张家港市| 当雄县| 孝昌县| 清镇市| 丰县| 康乐县| 贵溪市| 金阳县| 叶城县| 长沙县| 墨江| 济宁市| 巴彦县| 陇川县| 中宁县| 武乡县| 永川市| 贡嘎县| 渝北区| 江永县| 高淳县| 东宁县| 洮南市| 武强县| 通州区| 秦安县| 罗山县| 兴海县| 中牟县| 庆阳市|