javascript if shorthand
condition ? doThisIfTrue : doThisIfFalse
1 > 2 ? console.log(true) : console.log(false)
// returns false
javascript if shorthand
condition ? doThisIfTrue : doThisIfFalse
1 > 2 ? console.log(true) : console.log(false)
// returns false
shorthand if statment in js
isLoggedIn ? "Logout" : "Login";
shorthand if in javascript with return
pet = pets.find(pet => pet.type ==='Dog' && pet.name === 'Tommy');
console.log(pet); // { type: 'Dog', name: 'Tommy' }
shorthand if statement js
const answer = x > 10 ? "greater than 10" : "less than 10";
// or
if (something)
return;
// other code here
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us