I am creating an object to make it easier to access browser/system information by calling a function. One of those functions accesses the operating system name and version and returns a value.
const Sys = {
// retrieves the operating system
OS: function () {
// function body
}
// other functions...
}
I don't know how to go about getting the information I need. I did find a similar question on Stack Overflow, but it didn't get the correct information. For example, if I am running on a Windows 10 Pro 32-bit, I want the output to be "Windows 10 Pro 32-bit"
. I'm guessing I have to use the navigator
object, but other than that I really don't know anything else. Can anyone help with this?