Skip to content

Files

Latest commit

 

History

History
21 lines (14 loc) · 400 Bytes

prefer_if_null_operators.md

File metadata and controls

21 lines (14 loc) · 400 Bytes

Pattern: Missing use of if null operator

Issue: -

Description

Prefer using if null operators instead of null checks in conditional expressions.

Example of incorrect code:

v = a == null ? b : a;

Example of correct code:

v = a ?? b;

Further Reading