#5 Functions (Fundamentals of TS)
While writing a function in a TypeScript, give type for the function as well as the prop.
Example:
function User(age: number, id: number ):number {
if(age>20){
return id+2;}
else{
return id-2}
User(2,5);
Comments
Post a Comment