![TypeScript Tutorial](/typescript/images/typescript-mini-logo.jpg)
- TypeScript Tutorial
- TypeScript - Home
- TypeScript - Overview
- TypeScript - Environment Setup
- TypeScript - Basic Syntax
- TypeScript - Types
- TypeScript - Variables
- TypeScript - Operators
- TypeScript - Decision Making
- TypeScript - Loops
- TypeScript - Functions
- TypeScript - Numbers
- TypeScript - Strings
- TypeScript - Arrays
- TypeScript - Tuples
- TypeScript - Union
- TypeScript - Interfaces
- TypeScript - Classes
- TypeScript - Objects
- TypeScript - Namespaces
- TypeScript - Modules
- TypeScript - Ambients
- TypeScript Useful Resources
- TypeScript - Quick Guide
- TypeScript - Useful Resources
- TypeScript - Discussion
TypeScript - Defining a Function
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") }
typescript_functions.htm
Advertisements