Scripts execute in the order they appear. If you have script tags, the first one finishes before the second one starts:
<script src="first.js"></script>
<script src="second.js"></script>
This matters when one script depends on another. If second.js uses something defined in first.js, the order is correct. Reverse them, and you'll get errors because second.js runs before its dependency exists.