Skip to content

Commit a9bd1cd

Browse files
authored
The void operator
1 parent fb3caeb commit a9bd1cd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
|29 | [Detect if Browser Tab is in the view](#Detect-if-Browser-Tab-is-in-the-view)|
3636
|30 | [Private class methods and fields](#Private-class-methods-and-fields)|
3737
|31 | [Preventing paste into an input field](#Preventing-paste-into-an-input-field)|
38+
|32 | [The void operator](#The-void-operator)|
3839

3940

4041

@@ -658,5 +659,19 @@ pasteBox.onpaste = (e) => {
658659
```
659660
660661
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+
661667

668+
void 0; //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+
```
662677

0 commit comments

Comments
 (0)