it isn't actual collision but overlap. The problem is that after some time playing (like 5 min) the ball goes so fast that it would just jump over the paddle and not bounce. The game is in Spanish but its simple pong, controls are w,s for left and up/down_arrow for right. When you get to that point, you'll notice how the ball would just not bounce but pass the paddle as if it was invisible. I never knew how to fix it nor interested about it but since I always use libraries xd, don't know how they work but they do. For physics, which includes collision, gravity, etc, I like phaser.js
When I was learning Javascript, I made some kind of approach to collision:
https://simx72.github.io/Pong/
it isn't actual collision but overlap. The problem is that after some time playing (like 5 min) the ball goes so fast that it would just jump over the paddle and not bounce. The game is in Spanish but its simple pong, controls are w,s for left and up/down_arrow for right. When you get to that point, you'll notice how the ball would just not bounce but pass the paddle as if it was invisible. I never knew how to fix it nor interested about it but since I always use libraries xd, don't know how they work but they do. For physics, which includes collision, gravity, etc, I like phaser.js