1.读取属性值
console.log(cheng.name)
/* Tip:如果属性名是变量的情况下,使用中括号去读取 */
console.log(cheng["name"])
2.添加属性
cheng.love= "看电影"
console.log(cheng)
3.读取对象的属性和value值
Object.keys(obj)
Object.values(obj)
console.log(Object.keys(cheng))
console.log(Object.values(cheng))
4.遍历for
/* 6.for in */
for(var k in cheng){
console.log(k)
console.log(cheng[k])
}