Void is available only in TypeScriptThe void type is applicable to functions' return types (we will discuss this soon). Void indicates that a function is not expected to return anything:

let sum: number = 20// No return type functionfunction addToGlobalSum(numToAdd): void {        number + numToAdd}addToGlobalSum(30) console.log(number) // 50

Get TypeScript 2.x for Angular Developers now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.