Skip to content

Commit

Permalink
docs(contributing): better explanation for checking for undefined and…
Browse files Browse the repository at this point in the history
… null
  • Loading branch information
relu91 authored Sep 22, 2023
1 parent d56b778 commit 20387d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function(arg1: string | null | undefined) {
```
Instead of checking for both null and `undefined` values (`if (arg !== undefined && arg !== null)`) the preferred solution is to use `!=` or `==` operator. Interestingly in JavaScript
with `==`, `null` and `undefined` are only equal to each other. Example:
with `==`, `null` and `undefined` are equal to each other. Example:
```ts
function(arg1: string | null | undefined) {
Expand Down

0 comments on commit 20387d5

Please sign in to comment.