Did you know?

In Money Heist, Tokyo was the first character to get a name.

According to Jesus Colmenar, director and producer of the show, everything started when Money Heist creator Alex Pina came to work wearing a shirt that had the word “Tokyo” printed in front. Colmenar suddenly thought “Tokyo” would be the perfect name to give a character. - https://www.rappler.com/entertainment/series/money-heist-season-4-trivia

Ternary operator (?) is a basic conditional expression in several programming languages.

syntax - (condition) followed by ? then an expression to execute if the condition is true, followed by : then another expression to execute if the condition is false.

Example

Let's consider this coffee menu example.

var hasEspresso = true;
var hasMilkFoam = true;
var hasWhippedCream = false;
var hasSteamedMilk = false;
var hasHalfSteamed =  false;
var hasChocolateSyrup = false;
var hasWater = false;

var coffee_menu = (
                    hasEspresso && 
                    ! hasMilkFoam && 
                    ! hasWhippedCream && 
                    ! hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Espresso" :
                  (
                    hasEspresso &&  
                    hasMilkFoam && 
                    ! hasWhippedCream && 
                    ! hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Espresso Macchiato" :
                  (
                    hasEspresso && 
                    ! hasMilkFoam &&  
                    hasWhippedCream && 
                    ! hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Espresso con Panna" :
                  (
                    hasEspresso &&  
                    hasMilkFoam && 
                    ! hasWhippedCream &&  
                    hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Caffe Latte or Cappuccino" :
                  (
                    hasEspresso && 
                    ! hasMilkFoam && 
                    ! hasWhippedCream &&  
                    hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Flat White" :
                  (
                    hasEspresso &&  
                    hasMilkFoam &&  
                    ! hasWhippedCream && 
                    ! hasSteamedMilk && 
                    hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Cafe Breve" :
                  (
                    hasEspresso && 
                    ! hasMilkFoam &&   
                    hasWhippedCream &&  
                    hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    hasChocolateSyrup && 
                    ! hasWater
                  ) ?  "Caffe Mocha" :
                  (
                    hasEspresso && 
                    ! hasMilkFoam && 
                    ! hasWhippedCream && 
                    ! hasSteamedMilk && 
                    ! hasHalfSteamed && 
                    ! hasChocolateSyrup && 
                    hasWater
                  ) ?  "Americano" :
                 "unavailable";

//hasEspresso is true and hasMilkFoam is true

coffee_menu

Output

"Espresso Macchiato"

//hasEspresso is true, hasWhippedCream is true, hasSteamedMilk is true and hasChocolateSyrup is true

var hasEspresso = true;
var hasMilkFoam = false;
var hasWhippedCream = true;
var hasSteamedMilk = true;
var hasHalfSteamed =  false;
var hasChocolateSyrup = true;
var hasWater = false;
....

coffee_menu

Output

"Caffe Mocha"