1condition ? doThisIfTrue : doThisIfFalse
2
31 > 2 ? console.log(true) : console.log(false)
4// returns false
1pet = pets.find(pet => pet.type ==='Dog' && pet.name === 'Tommy');
2console.log(pet); // { type: 'Dog', name: 'Tommy' }
3
1const answer = x > 10 ? "greater than 10" : "less than 10";
2
3// or
4
5if (something)
6 return;
7// other code here