1. void operates the expression and ignores its return value, such as void (1+2), void (0)
The code copy is as follows:
<html>
<head>
<meta http-equiv="content-type" charset="utf-8"/>
<script type="text/javascript">
alert(typeof(void(0))); //void(0) calculates the value 0. Since the return value is ignored, the typeof type is: undefined
</script>
</head>
<body>
1. Use onclick events to handle flexibly; 2. void(expression)<br>
<a href="javascript:void(0);" onclick="location.href='http://www.baidu.com';">Baidu</a>
<a href="javascript:void(location.href='http://www.google.com')">Google</a>
</body>
</html>
2.typeof returns the type of a variable or value, such as typeof(void 1+2) , typeof(void(1+2))
Due to operator priority, the operation process of void 1+2 is:
3.new is used to create an object column of the specified class
4. Delete deletes the real column attribute. There are several points that must be paid attention to for delete:
1. Only delete the real column attributes, not the object
The code copy is as follows:
<html>
<head>
<meta http-equiv="content-type" charset="utf-8"/>
<script type="text/javascript">
var parent={};
var son={age:10};
parent.son=son;
alert(parent.son.age);//10
delete parent.son;
alert(parent.son);//undefined
alert(son.age);//10
</script>
</head>
<body>
</body>
</html>