Empty function result in TypeScript
There are functions that return nothing. In this case, the keyword void is specified as the result. See the example:
function func(test: string): void {
alert(test);
}
Specify the return type:
function func(text: string) {
console.log(elem);
}