1. void operation expression and ignore its return value, such as void (1 + 2), void (0)
Copy codeThe Code is as follows:
<Html>
<Head>
<Meta http-equiv = "content-type" charset = "UTF-8"/>
<Script type = "text/javascript">
Alert (typeof (void (0); // void (0) is calculated as 0. Because the returned value is ignored, the typeof type is undefined.
</Script>
</Head>
<Body>
1. Use the onclick event for flexible processing; 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: Type of the returned variable or value, such as typeof (void 1 + 2) and typeof (void (1 + 2 ))
Given the operator priority, void 1 + 2 is calculated as follows:
3. new is used to create the object real column of the specified class.
4. delete to delete the real-column attribute. Note the following when deleting:
1. Only Delete the real column attribute, but not the object
Copy codeThe Code 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>