The function statement is not the only way to define a new function; you can define your function dynamically using Function() constructor along with the new operator.
Note − Constructor is a terminology from Object Oriented Programming. You may not feel comfortable for the first time, which is OK.
Following is the syntax to create a function using Function( ) constructor along with the new operator.
Notice that the Function() constructor is not passed any argument that specifies a name for the function it creates. The unnamed functions created with the Function() constructor are called anonymous functions.
Try the following example.