JavaScript functions are objects. They can be defined using the Function
constructor, like so:
>>> var sum = new Function('a', 'b', 'return a + b;');
This is equivalent to the function literal:
>>> var sum = function(a, b){return a + b;};
or the more common:
>>> function sum(a, b){return a + b;}
The use of the Function
constructor is discouraged in favor of the function literals.