What is the reason for the compiler throwing errors in the following TypeScript code snippet? 

function calculateArea(length:number, breadth:number) { 
return length * breadth; 
} 

Assume that you provide “abc” and 5 as the input to the function calculateArea.

No error in the code.

Type Annotation Error.

Function return type has to be mentioned.

None of the options are correct.

Verified Answer
Correct Option - b

To get all Infosys Certified TypeScript Professional Exam questions Join Telegram Group https://bit.ly/infy_premium_group

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Tue, 1 Jul 2025