JS - the non-traditional condition with ?

0 votes
246 views
added Jul 6, 2018 in Javascript by LC Marshal Captain (25,790 points)
edited Jul 13, 2018 by LC Marshal
//Non-traditional use of ‘?’
let myOffice = prompt('Where my office located?', '');
(myOffice == 'Budapest') ?
 alert('Right!') : alert('Wrong.');
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...