How to retrieve userID

Hello, is there a way to getUserId I’ve set when i started tracker? I mean in code in some later point after tracker.start({userId:‘some-id@mail.no’}) and later something like tracker.getUserId() (or something similar) ?
Alternately how can i find out if it is setup or it is anonymous session?

image