webgl camera

I would create an orbit camera for webgl , i won’t copy and paste any orbit camera that there is in a opensource library , i would understand how create one.
I see that is a bit different create a camera for opengl and opengl es.
And the javascript events for mouse rotation and the wheel?
How connect they to a camera object in javascript(that’s like a class in c++)?

then books , articles , tutorial are welcome