Datatypes

  • Total 7 Datatypes in Javascript
  • Primitive Datatypes (6)
    • undefined:
      • variables are undefined after initialization
      • numerical operations on undefined cause NaN
      • stringoperations on undefined cause "undefined"-String as result
    • null
    • boolean
    • string
    • symbol
    • number
  • Complex Datatypes (1)
    • object: complex datatype!
  • Get Datatype (Code Example):
typeof("hello");  // returns datatype as string

Checking Datatypes

Number.isInteger("2017"); // false
Number.isInteger(2017);   // true