Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Your Answer is superb but can you tell me what is wrong with this

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

var generate = function (f) {

    function double(x){return x * 2;}
    
    var list = [f,double];
     return list;
    
};


I'm sorry I can't. I'm not into the details of Javascript (yet) and know nothing about JSLint.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: