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

Your snippet doesn't fail. This one does

    console.log('this doesn't work!')
    (false ? console.log : console.error)('this will fail with a TypeError')
    >> Uncaught TypeError: console.log(...) is not a function

    console.log('this works!')
    ;(true ? console.log : console.error)('hello world')


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

Search: