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

  • 關於本站
  • 免責聲明