divya interview question

Basic intermediate question of react js