wiki/content/20201124091530-typescript_strictnullchecks.md

20 lines
257 B
Markdown
Raw Normal View History

2024-05-06 20:40:05 +00:00
---
2024-10-30 17:34:11 +00:00
date: 2020-11-24
2024-05-06 20:40:05 +00:00
id: 40929849-a8dc-4293-8e24-afa2ff04620d
title: TypeScript strictNullChecks
---
# Description
Check if variable is null
# Syntax
``` typescript
function foo(a?: number | null) {
if (a == null) return;
// a is number now.
}
```