1、基本数据类型只传值
<script>
//基本数据类型在赋值运算中只传值
var a = 20;
var b= a;
console.log(a); //20
console.log(b); //20
</script>
2、引用数据类型 既传值也传址 占两块内存
<script>
var obj = [
{name:"李四"}
]
var wang = obj;
obj.age = 18;
wang.sex = "男"
console.log(obj);
console.log(wang);
</script>