I have tried using the code below but it only display results in Chrome and Mozilla not working in IE6.
Code to detect the operating system of an user
let os = navigator.userAgent.slice(13).split(';') os = os[0]
console.log(os)
Windows NT 10.0