How to find operating system in the client machine using JavaScript?

How to find operating system in the client machine using JavaScript?

We need to use “navigator. appVersion” or “navigator. userAgent” property. Such property will return read-only text format for such activities.