Javascript datatypes
JavaScript

Javascript datatypes

Editorial Team
Editorial Team

Follow us on Discord or Telegram to get access to free tutorials and updates.

Datatypes are used to hold different types of values. JavaScript supports the following three primitive datatypes.

  • Numbers – It can be a whole number of a fractional number.
  • String – A string is used to hold a series of characters.
  • Boolean –  Boolean datatype can hold only two values – TRUE or FALSE.

Things to remember

  • Strings are written inside double or single quotes.
  • Integers are written without a single or double quote.
  • JavaScript treats all numbers as 64-bit floating-point values.

Following is a list of JavaScript datatypes.

DatatypeType
StringPrimitive
NumberPrimitive
BooleanPrimitive
ObjectComposite