JSFiddle - React, Tailwind, and code Playground

by Slico

JavaScript

/**
 * Create 2 ternary operations to:
 * 1: check if guy is available, he is available if time is greater than 5
 * 2: check if a girl is available, she is available if time is lower than 10
 * they can both meet if they are available
 */

const time = 6;
let guy = (time > 5) ? true : false;
let girl = (time < 10) ? true : false;


let result = (guy && girl) ? "They can have a tinder date" : "They can't have a tinder date"

/*if (guy == true && girl== true) {
  result = "They can have a tinder date"
} else {
  result = "They can't have a tinder date"
}*/
console.log(result)



/**
 * Output both are available and can meet: "They can have a tinder date"
 * Output if they cant: "They can't have a tinder date"
 */