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

Anyone else try to do a lazy AND evaluation for chapter 12 and have it fail? I did

fC(gC(function(){success,failure};),failure);

but the desired answer checked gC even if fC already failed..



You're passing in the return value of gC() as the first parameter to fC(). gC() doesn't return anything, let alone a function. Also, you're only passing in one parameter into gC().

I'm not sure that makes sense?


My first attempt was about the same, until I realized I missed a requirement:

> Your function bothC should call both fC and gC no matter what

What happens in your code if fC fails?


Ah good point, forgot about that requirement.




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

Search: