Infosys Interview Question

How Java script works behind the screens?