It is often convenient to split a complex javascript file in different files. In this case, make sure to import all the files:

<div id="sketch-holder">
    <script type="text/javascript" src="sketch/Particle.js"></script>
    <script type="text/javascript" src="sketch/ParticleSystem.js"></script>
    <script type="text/javascript" src="sketch/sketch.js"></script>
</div>

This particle system is one of p5.js official examples: