- 类型
基本类型:访问基本类型时,应该直接操作类型值
string number boolean null undefined
var a = 0 ;
var b = a ;
b = 8 ;
console.log(a,b) ; //0,8
注:
1、JavaScript中调用console写日志。
2、打开IE开发者工具后才能使用console,默认访问IE的console对象会出错。
复合类型:访问复合类型时,应该操作其引用
object array function
var a = [1,2] ;
var b = a ;
b[0] = 9
console.log(a[0],b[0]);//9,9
1:1 In the beginning God created the heaven and the earth.