Adjust interview question

two tasks in javascript regarding react