how javascript programs run internally