XYZ (Hong Kong) Interview Question

explain Java script and complete machine coding test