Math, asked by KarmaAkabane4482, 1 year ago

An expression of type 'void' cannot be tested for truthiness angular 7

Answers

Answered by sailorking
2

Answer:

Void option is used only when there is no datatype to be returned since void stands for no datatype and nothing can be returned. for example :-

function test(): void { console.log("hi");}

Step-by-step explanation

  1. No data types are included in the above expression.
  2. hi is just displayed on the console.
  3. No input is also accepted and no output is to be returned.

Similar questions