Javascript - Function Constructor (Dynamic Coding)

> (World Wide) Web - (W3|WWW) > Javascript (Js|ECMAScript) > ECMAScript - Grammar Standard

1 - About

Function can be create from a string as an object constructor with the new keyword

Advertising

3 - Syntax

new Function ([arg1[, arg2[, ...argN]],] functionBody)

4 - Example

var adder = new Function("a", "b", "return a + b" );
// Call the function
console.log(adder(2, 3));

5 - Documentation / Reference

web/javascript/es/function_constructor.txt · Last modified: 2019/02/16 17:40 by gerardnico