Data Types

Primitive Data Types

  • Number Any number

    console.log(2011)

    \

  • String Any continous set of alphabets inside single or double inverted commas

    console.log('JavaScript')

    \

  • Boolean Two values

    1. true

    2. false

    console.log(1 == 1) // Gives a boolean "true"

    \

  • Null You can assign null to a variable to denote that currently that variable does not have any value but it will have later on. A null means absence of a value.\

  • Undefined Undefined property indicates that a variable has not been assigned a value, or not declared at all.\

  • Symbol

  • Object

Last updated