Categories Javascript Typescript

Typescript Functions Clone C

TypeScript has a specific syntax for typing function parameters and return values.

Read more about functions here.

Return Type

The type of the value returned by the function can be explicitly defined.

// the `: number` here specifies that this function returns a number
function getTime(): number {
  return new Date().getTime();
}

More From Author

Leave a Reply

Your email address will not be published. Required fields are marked *