|
35 | 35 | |29|[Detect if Browser Tab is in the view](#Detect-if-Browser-Tab-is-in-the-view)| |
36 | 36 | |30|[Private class methods and fields](#Private-class-methods-and-fields)| |
37 | 37 | |31|[Preventing paste into an input field](#Preventing-paste-into-an-input-field)| |
| 38 | +|32|[The void operator](#The-void-operator)| |
38 | 39 |
|
39 | 40 |
|
40 | 41 |
|
@@ -658,5 +659,19 @@ pasteBox.onpaste = (e) => { |
658 | 659 | ``` |
659 | 660 |
|
660 | 661 |
|
| 662 | +**[⬆ Back to Top](#table-of-contents)** |
| 663 | +### The void operator |
| 664 | +The void operator evaluates the given expression and then returns undefined. |
| 665 | +```javascript |
| 666 | + |
661 | 667 |
|
| 668 | +void0;//returns undefined |
| 669 | +void (0);//returns undefined |
| 670 | +void {};//returns undefined |
| 671 | +void"JSsnippets; //returns undefined |
| 672 | +void (0); //returns undefined |
| 673 | +void (2 == '2'); //returns undefined |
| 674 | +void anyfunction(); //returns undefined |
| 675 | +
|
| 676 | +``` |
662 | 677 |
|