With their default linear starting trajectory most particles quickly pass out of bounds. Adding a black hole may bring particles into orbit and keep them in bounds for as long as the black hole is active. If a particle gets too close to the black hole it may accelerate enough to break orbit and head out of bounds.

A 'white hole' will push particles towards bounds; but particles are less likely to see the super-acceleration caused by passing too close to a black hole.

A counter now displays the number of active particles. Since particle behaviour is now more complex; they are not processed once they pass out of bounds...

source code
Note that you need to use Browserify to bundle the separate files; with 'main_sketch.js' being the access point.