Hacker News new | ask | show | jobs
by madamelic 2977 days ago
`request.statusCode == 200 && { body: {} } || request.statusCode == 404 && 'Not Found' || throw new Error('Something happened')`

This is basically what they could translate into without having if/else or nested ternaries.

I'm not sure if it is much better than either but I like it more.