An expression of type 'void' cannot be tested for truthiness angular 7
Answers
Answered by
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
- No data types are included in the above expression.
- hi is just displayed on the console.
- No input is also accepted and no output is to be returned.
Similar questions
Environmental Sciences,
6 months ago
Science,
6 months ago
Science,
6 months ago
Science,
1 year ago