In the first example, viewport appears to be a custom variable inside camera. That’s why it is not documented. You can check the source code of Camera, PerspectiveCamera and StereoCamera. Neither of them defines property viewport.
The second example uses the method viewport(...) which is part of the rendering context – it is external to Three.js, not a part of it. The documentation points to WebGLRenderingContext, that describes the viewport method.
By example I mean the piece of code posted in your message.
Otherwise, yes, I got confused because there are two distinct viewports in the second example → the value viewport and the method viewport. Initially I thought you are referring to the method.
In any case, if viewport is used outside the class, it is better to be documented, because someone else might need to restore the viewport and will have no clue that it is already stored in the camera.