What is the best way to detect MacOS, iOS, Windows, Android, and Linux operating systems with JavaScript?
The answer should return the type of the OS regardless of the device. For e.g. iOS is used on iPhone, iPad and answer should return iOS as OS type.
Looking for answers which do not use the navigator.platform property since it is deprecated.