1.

Provide the syntax of a function with the type annotations.

Answer»

Functions are blocks of code to perform a specific code. Functions can optionally take one or more arguments, process them, and optionally RETURN a value.

Here’s the TYPESCRIPT syntax to create and call a function.

function GREET(name: string): string { return `Hello, ${name}`;}let GREETING = greet("Anders");console.log(greeting); // "Hello, Anders"


Discussion

No Comment Found