Indegene interview question

Basic to advance question in javascript, Reactjs