get system platform in javascript

You can use the navigator.platform property to get the operating system platform in JavaScript. This property returns a string representing the platform of the browser in use. Here's an example:

index.tsx
const platform = navigator.platform;
console.log(platform);
60 chars
3 lines

This will output a string like "Win32" or "MacIntel". This property is not always reliable, as some browsers may return incorrect or misleading information. You should use it as a rough guide only.

gistlibby LogSnag