How to use conditional ternary operator for mulitple cases javascript?
Hi i am trying to use ternary operator for multiple cases. below is the code snippet, const status_color_to_icon_name = { white: 'info', orange: 'major', } const default_icon_name = 'icon1'; <Icon name={status_color_to_icon_name[item.color] ?? default_icon_name} color= {item.color} /> the above works fine.…