Skip to content

Files

Latest commit

 

History

History
23 lines (16 loc) · 447 Bytes

unnecessary_null_aware_assignments.md

File metadata and controls

23 lines (16 loc) · 447 Bytes

Pattern: Unnecessary null-aware assignment

Issue: -

Description

Using null on the right-hand side of a null-aware assignment effectively makes the assignment redundant.

Example of correct code:

var x;
x ??= 1;

Example of incorrect code:

var x;
x ??= null;

Further Reading