Web Directions Global Scope 2021 All about JavaScript the language

Session Details

James Sinclair

Rethinking the JavaScript ternary operator

James Sinclair Senior Developer Atlassian

Lots of people treat the ternary operator with suspicion. At first glance, ternaries appear unnecessary. Nothing more than a tool for the overly-clever to trim some characters from their code; a favourite hack for coders who don’t care about readability. And sure, it’s all too easy to turn ternaries into an indecipherable mess. But what if we’re missing something? What if there's more to ternaries than meets the eye?

We’ll take a deep look at what makes a ternary different from an if-statement. And we’ll explore ways to write safer conditionals. Finally, we’ll examine the do-expression TC39 proposal and explore how it might help the situation.

James Sinclair

James (@jrsinclair) is a Senior Developer with Atlassian. He works with JavaScript (in various flavours) on both the front and back-end. He's passionate about functional programming, and good software-engineering practice in general. Over the years he's worked on web projects for Ford Motor Company, Bendigo Bank, The Australian Broadcasting Corporation, Monash University, and the Prime Minister of Australia. Somewhere along the way he picked up a PhD in Information Architecture but decided building stuff on the web was more fun than being an academic.

Don't miss your chance to see James Sinclair and many other inspiring speakers at Global Scope.

Tickets start at $145.

Register Now

a conference all about JavaScript the language

Register Now

Code of Conduct

For over a decade, we've worked hard to create inclusive, fun, inspring and safe events for the Web Industry.

As part of our commitment to these values, we've adopted a code of conduct for all involved: ourselves, our speakers, our partners and our audience.

If you have any concern or feedback, please don't hesitate to contact us.