Get Array Input Value Javascript Interview Question