Start of main content
Detect device type
Detects whether the page is being viewed on a mobile device or a desktop.
- Use a regular expression to test the
Navigator.userAgent property to figure out if the device is a mobile device or a desktop.
const detectDeviceType = () =>
More like this
Collection · 6 snippets
Checks if touch events are supported.
Creates an object containing the parameters of the current URL.