I came across the below construct in one of my react components written by someone and it got me intrigued.
const [activeStep, setActiveStep] = React.useState('text1')
const [a,b,c,d]=(()=>(
{
'text1': [text2, text3, text4, ['text5']]
}[activeStep]))()
This might be a naive question but I did not know how to search for this on internet without knowing the name of this construct. Apologies if this is a duplicate question because I tried searching using the construct directly without the text but nothing showed up. Appreciate your help in advance. Cheers!