logo
  • 教程列表
  • SO官方文档
  • TypeScript 核心类型
    • 字符串文字类型
    • 元组
    • 布尔
    • 交叉类型
    • 数
    • 字符串
    • 排列
    • 枚举
    • 任何
    • void
    • 函数参数和返回值中的类型。数
    • 函数参数和返回值中的类型。字符串
    • const Enum
  1. StackOverflow 文档
  2. TypeScript 教程
  3. TypeScript 核心类型
  4. void

void

Created: November-22, 2018

如果你根本没有类型,通常用于不返回任何内容的函数:

function log(): void {
    console.log('I return nothing');
}

void 类型只能分配 null 或 undefined。

  • 函数参数和返回值中的类型。数
  • 任何

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明