How to detect the operating system on the client machine?

In order to detect the operating system on the client machine, the navigator.appVersionstring (property) should be used.