KPMG Interview Question

common question in react and javascript