JavaScript Data types

Javascript Datatypes

There are 2 different data types in JavaScript. In JavaScript, all numbers are encoded as double precision floating point numbers, following the international IEEE 754 standard. This format stores numbers in 64 bits, where the number, the fraction (AKA mantissa), is stored in bits 0 to 51, the exponent in bits 52 to 62, and the sign in bit 63. In other programming languages floats are a separate primitive datatype. In JavaScript they are encoded the same.

Primitive and Non-Primitive (Composite types)

List of Primitive Datatypes
  • Number
  • float
  • Boolean
  • String
  • Null
  • Undefined
  • Symbol
List of Non-Primitive (Composite types)
  • Array
  • Object
  • Function
  • Date
  • Regex
Javascript Datatypes Example

The DOM (Document Object Model)

The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document with a logical tree. Each branch of the tree ends in a node.

Dom diagram 01

The HTML DOM

Dom diagram 02