Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Non-ternary:
- type arg;
- if (something) {
- arg = a;
- } else {
- arg = b;
- }
- function(arg);
- Ternary:
- function(something ? a : b);
- - Less complex to write
- - Less expensive for a compiler
- - No need for variable "arg" of the correct type
Add Comment
Please, Sign In to add comment