• 1.1 基本类型: 直接存取基本类型。

      • 字符串
      • 数值
      • 布尔类型
      • null
      • undefined
    1. const foo = 1;
    2. let bar = foo;
    3. bar = 9;
    4. console.log(foo, bar); // => 1, 9
    • 1.2 复制类型: 通过引用的方式存取复杂类型。

      • 对象
      • 数组
      • 函数
    1. const foo = [1, 2];
    2. const bar = foo;
    3. bar[0] = 9;
    4. console.log(foo[0], bar[0]); // => 9, 9