boolean statement ? true result : false result;
/*
For example, if we take this if statement:
*/
if (a > b) {
result = x;
} else {
result = y;
}
// can be also writen:
result = a > b ? x : y;
//This is what is called a 'Conditional operator'
let result = condition ? value1 : value2
// ^^ ^^ ^^
let result = 1 == 2 ? "YES" : "NO!"
console.log(result) //output: "NO!"
//Basically a short form of an if-else statment
(condition) ? {code for YES} : {code for NO}