Ternary
Inline conditional.
💡 THINK OF IT LIKE…
▸ YOUR TURN
Declare const label = x > 0 ? "pos" : "neg";
Tab indent · Shift+Tab outdent · ⌘/Ctrl + Enter submit · auto-pairs ( [ { " '
Click 'Run code' to execute your code in a real sandbox.
Inline conditional.
Declare const label = x > 0 ? "pos" : "neg";
Click 'Run code' to execute your code in a real sandbox.