The library p5js is a flavor of Processing targeting the JS language.
Processing’s flavor p5*js got the biggest upper hand b/c it runs inside browsers.
Although if we use just the bare Processing API we can deploy sketches coded on its Java Mode to run on a browser too via Pjs (which is another flavor targeting JS btW).
The strongest advantage Processing’s Java Mode main flavor got is debugging.
Debugging in JS is much harder than debugging in Java.