<script>
var obj={
name : "jack",
age : 20,
location: "dalian"
}
// document.write("name:"+obj.name)
// document.write("<br>")
// document.write("age:"+obj.age)
// document.write("<br>")
// document.write("location:"+obj.location)
// document.write("<br>")
for(var i in obj){
// 获取key
console.log(i)
// 获取value
console.log(obj[i])
document.write(i+":"+obj[i])
document.write("<br>")
}
</script>