This post first appeared on hackinbits.com
The data types in javascript can be divided as Primitive and Object.
Primitive Data Types:
In Javascript, all values except Objects are defined as immutable values (values that cannot be changed or modified). There is a total of 6 primitive types defined by the latest ECMAScript standard:
- boolean
- null
- undefined
- number
- string
- symbol(new in ECMAScript 2015)
Object Data Type:
Object type refers to a compound value that can be seen as a collection of properties. Properties are key/value pairs. Keys are strings (or Symbols) and values can be of any type, including other objects.
var obj = {
name: 'Cheese Burger',
cost: 5,
extra_cheese: true
};
Top comments (0)