Skip to content

Commit

Permalink
add mdn link for ??
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Dec 8, 2022
1 parent 97630b6 commit 134da21
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions client/docs/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -419,3 +419,5 @@ Use `??` to assign default values.
> **Reason**
>
> The `??` operator uses the right hand value, when the left hand one is unassigned (`undefined` or `null`), while `||` does this on all falsely values (eg. `false` or `0`). This can lead to unexpected bugs in edge cases.
>
> [Read more on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing#assigning_a_default_value_to_a_variable)

0 comments on commit 134da21

Please sign in to comment.