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

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
主站蜘蛛池模板: 玛多县| 舞钢市| 伊川县| 峡江县| 宁蒗| 阿坝县| 惠来县| 南宫市| 宜兰市| 洛阳市| 新和县| 政和县| 铜川市| 大丰市| 京山县| 新宾| 亳州市| 德保县| 泽库县| 麟游县| 湟源县| 四子王旗| 三亚市| 罗山县| 大田县| 长乐市| 依兰县| 深州市| 萝北县| 余姚市| 青田县| 右玉县| 崇文区| 海兴县| 漳州市| 双江| 隆德县| 科技| 定边县| 保靖县| 分宜县|