Skip to content

Latest commit

 

History

History
38 lines (34 loc) · 954 Bytes

File metadata and controls

38 lines (34 loc) · 954 Bytes

Types, Values, and Variables Back

  • JavaScript's types can be divided into primitive types and object types.
  • JavaScript's types can also be categorized as mutable and immutable types.
    • mutable types: value can change
      • Objects
      • Arrays
      • ...
    • immutable types: value can not change
      • Numbers
      • booleans
      • null
      • undefined
      • strings
      • symbol (new in ES6)
      • ...
var x;
x = 0;
x	//=>0

//JavaScript supports several types of values
x = 1;	//integers
x = 0.1;	//real
x = "Aloha";	//String in quatation marks
x = 'Aloha';	//String in single quatations 
x = true;	//boolean
x = null;	//no value
x = undefined;	//like null