-
Notifications
You must be signed in to change notification settings - Fork 1
Data types and data structures
teja463 edited this page Mar 20, 2017
·
2 revisions
Variables have different data types. There are different datat types a variable can contain
var x = 10; //Number type
var y = 'Hello' //String type
- String
- Number
- Boolean
- Array
- Object
The latest ECMAScript standard defines seven data types:
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
All primitive data types are immutable. Object is not primitive so it is mutable.
- Boolean
- Null
- Undefined
- Number
- String
- Symbol (new in ECMAScript 6)
- Object (Non Premitive)