Easy learning with example program codes

Typescript function constructor tutorial

A TypeScript function is a group of statements which is used for performing a specific task. It provides the facility of code re-usability.

TypeScript provides the facility to create a function with the built-in JavaScript constructor called Function ().

Typescript function constructor syntax:

var result = new Function( [arguments] ) { ... }

Typescript function constructor example:

var myFunction = new Function("num1", "num2", "return num1 + num2"); 
var result = myFunction(10, 15); 

Try it:

JS Bin on

Please follow and like us:

Copyright © 2019 CodesJava Protection Status SiteMap Reference: Java Wiki