var person={
name:'xiongwei',
age:26,
location:'ShenZhen'
}
console.log(person.name) //xiongwei
console.log(person['name'])//xiongwei
console.log(person[name])//undefined
注意:json以中括号的形式访问属性时必须打上双引号,否则undifined
var person={
name:'xiongwei',
age:26,
location:'ShenZhen'
}
console.log(person.name) //xiongwei
console.log(person['name'])//xiongwei
console.log(person[name])//undefined
注意:json以中括号的形式访问属性时必须打上双引号,否则undifined