<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			var obj = {
				name:'whjj',
				sex:'nan',
				age:28
			}
		obj.wight = 60//增
		obj.uu
		delete obj.sex //删
		obj.name = "whl"//改
		console.log("name" in obj)//true
		console.log("uu" in obj)//false
		console.log("wight" in obj)//false
		console.log("toString" in obj)// 原型链上属性 true
		console.log(obj.hasOwnProperty('wight')) //true
		console.log(obj.hasOwnProperty('toString')) // 原型链上属性 false
		for(var key in obj){
		  //if(arr.hasOwnProperty(key))
		  console.log(key);        //键名
		  console.log(obj[key]);   //键值
		}
		console.log(Object.keys(obj)) //["name", "age", "wight"]
		console.log(Object.values(obj)) //["whl", 28, 60]
//		console.log(obj)
		</script>
		
	</body>
</html>

  

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。