if then javascript shorthand code example
Example 1: shorthand if statment in js
isLoggedIn ? "Logout" : "Login";
Example 2: shorthand if in javascript with return
pet = pets.find(pet => pet.type ==='Dog' && pet.name === 'Tommy');
console.log(pet); // { type: 'Dog', name: 'Tommy' }