var ... = function( ... ){ ... };
var generate = function( ... ){ ... };
var generate = function( f ){ ... };
var generate = function( f ){ return [ ... ]; };
var generate = function( f ){ return [ f, ... ]; };
var generate = function( f ){ return [ f, function( ... ){ ... } ]; };
var generate = function( f ){ return [ f, function( x ){ return 2*x; } ]; };
var generate = function (f) {
var double = function (x){return x * 2;}; var list = [f,double]; return list;
On the other hand this one passes the JSLInt test given here at : http://nathansjslessons.appspot.com/lesson?id=1050
function double(x){return x * 2;} var list = [f,double]; return list;