Newel Technologies interview question

Basic JS and react.js question