Skip to content

Is ternary operator meant to use lazy evaluation? #797

Answered by antonmedv
mdmcconnell asked this question in Q&A

You must be logged in to vote

Yes! Ternary operator designed to be short circuiting.

If you need to run both expressions, assign the to variables. And use ternary operator on them.

Replies: 2 comments 3 replies

You must be logged in to vote
0 replies
Answer selected by antonmedv

You must be logged in to vote
3 replies
@mdmcconnell

@antonmedv

@mdmcconnell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants