Concept: First, the function is a special type of data, the function is also a type of data, in fact, the function is also an object, function object of the built-in constructor is function ();
Several ways to create a function:
Function declaration method:
function sum (A, b) {return a+b; } ;
Function Text Identification method
var sum = function (A, b) {return a+b;} ;
Function Builder method
var sum= new Function (' A ', ' B ', ' return a+b; ');
A function created using the function constructor method, whose arguments and code snippets are passed in as a string, is equivalent to eval (), where the script checks the output as a string;
var xstring = new Function (' A ', ' B ', ' C ', ' return arguments ');
xstring (' Hello ', 2, ' a ');//output An array containing the list of parameters ["Hello", 2, "a"]
<hr style= "font-size:2px;"/>
About the functions () function object of those small 99