TypeScript – Defining a Function

function definition

A function definition specifies what and how a specific task would be done. Before using a function, it must be defined. Functions are defined using the function keyword. The syntax for defining a standard function is given below −

Syntax

function  function_name() { 
   // function body 
}

Example: simple function definition

function () {   
   //function definition 
   console.log("function called") 
}

Previous page:-Click Here

Leave a Reply