Most JavaScript will consist of three things:

  1. the thing which starts it running
  2. the thing which contains the code
  3. the code

You will learn those a bit at a time and then use that structure over and over again.