---
title: Void Type
localeTitle: 空洞类型
---
# 空洞类型

不应该用于变量，使用`null`或`undefined` 。  
但是，将它用于不返回值的函数。

```typescript
const greeting(): void { 
    alert('Hello, and Welcome to My Webpage!'); 
 } 

```