How to add/push a new object to array upon mouse click in p5.js

You were NOT using balls.length but num_balls instead! :face_with_monocle:

for (let i = 0; i < num_balls; i++) {