Animations
API
Arrays
Async
Basics
Challenges
Classes
Console
Dates
Debugging
DOM Elements
DOM Methods
DOM Properties
Event Listeners
Flow Control
Forms
Functions
Global Functions
JSON
Keywords
Libraries (3rd party)
Math
Modules
Objects
Snippets
String
Types
Widgets
Window Object
A ternary operator is a conditional operator that assigns a value to a variable based on some condition. This works just like an if, else statement and is great for value assignments. You can only assign values, you cannot have blocks of complicated code within.
let voteable = (age < 18) ? "Too young" : "Old enough" ;