Sigma Solve interview question

Basic concept of react and javascript.