Infosys interview question

How Java script works behind the screens?