Just like objects, functions have properties and methods, they can be stored in a variable or an array, and be passed as arguments to other functions.
As all other objects, Function objects can be created using the new operator as shown below.
new Function ([arg1[, arg2[, ....argn]],] functionBody)
Function constructor to create functions is not recommended since it needs the function body as a string which may prevent some JS engine optimizations and can also cause other problems.
<script> var add=new Function("num1","num2","return num1+num2"); document.writeln(add(2,5)); //Output will be 7 </script>
|apply()||It is used to call a function contains this value and a single array of arguments.|
|bind()||It is used to create a new function.|
|call()||It is used to call a function contains this value and an argument list.|
|toString()||It returns the result in a form of a string.|