Let's assume that you have the following conditions:
javascriptvar name = '🤷♂️' if(poor) name = 'Erik' else if(rich) name = 'Messi' else if(super_rich) name = 'Bezos'
To translate it into ternary operators (concatenate multiple of them):
javascriptvar name = poor ? 'Erik' : rich ? 'Messi' : super_rich ? 'Bezos' : '🤷♂️'
Or in vertical:
javascriptvar name = poor ? 'Erik' : rich ? 'Messi' : super_rich ? 'Bezos' : /* default */ '🤷♂️'
Hi, I'm Erik, an engineer from Barcelona. If you like the post or have any comments, say hi.