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

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
主站蜘蛛池模板: 乐清市| 乡宁县| 视频| 沂南县| 通许县| 油尖旺区| 扶风县| 红安县| 平昌县| 行唐县| 西华县| 博客| 绥芬河市| 云南省| 东海县| 确山县| 鹤峰县| 哈巴河县| 邹城市| 富宁县| 巴林右旗| 临沧市| 孝昌县| 海丰县| 镇安县| 松潘县| 耒阳市| 游戏| 巧家县| 恩平市| 南漳县| 凉城县| 峨边| 韩城市| 冕宁县| 上蔡县| 天台县| 唐山市| 太康县| 汪清县| 新龙县|