Control structures 02: Ternary


const light = 'green';
let action = '';

if (light === 'green') {
  action = 'Go';
} else {
  action = 'Stay still';
}

Rewrite the previous code by using the ternary operator.







Join the waiting list to see the solution