Fixed typo and added examples

This commit is contained in:
Arjun Mahishi
2017-12-24 13:10:31 +05:30
parent 391b9cdcfe
commit 99a1564b65

View File

@ -3,5 +3,8 @@
Detects weather the website is being opened in a mobile device or a desktop
```js
const detectDevice = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop";
const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop";
detectDeviceType() -> "Mobile"
detectDeviceType() -> "Desktop"
```