shorthand if statment in js

JavaScript
 isLoggedIn ? "Logout" : "Login";
Source

Also in JavaScript: