Hacker News new | past | comments | ask | show | jobs | submit login

For anyone still/stuck with console debugging, “pro” tip:

JS ignores the value of every statement in a comma-separated expression except the last one. So you can do trash like this:

    const foo = (bar) => (
        console.log(bar),
        someComputationOf(bar)
    );
And log-debug without restructuring your otherwise pure function.



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

Search: