P5.js is a library, which works on top of javascript. It provides and extends the functionality of js for drawing things. And javascript itself is a programming language. When you are using p5.js you are using javascript.
You can do all the things that js provides in the sketch. But probably you have not used most part of js while making sketch.
I encourage you to learn js. While p5.js is a good start for beginners you need to learn other technologies(remember you do not need to know all.) to be a nice developer.
3 Likes