Skip to content

Data types and data structures

teja463 edited this page Mar 20, 2017 · 2 revisions

Varialbes

Variables have different data types. There are different datat types a variable can contain

var x = 10; //Number type
var y = 'Hello' //String type
  1. String
  2. Number
  3. Boolean
  4. Array
  5. Object

Data types

The latest ECMAScript standard defines seven data types:

Dynamic typing

JavaScript is a loosely typed or a dynamic language. That means you don't have to declare the type of a variable ahead of time. The type will get determined automatically while the program is being processed. That also means that you can have the same variable as different types

Six Primitive data types :

All primitive data types are immutable. Object is not primitive so it is mutable.

  1. Boolean
  2. Null
  3. Undefined
  4. Number
  5. String
  6. Symbol (new in ECMAScript 6)
  7. Object (Non Premitive)

Clone this wiki locally