Fixed typo and added examples
This commit is contained in:
@ -3,5 +3,8 @@
|
|||||||
Detects weather the website is being opened in a mobile device or a desktop
|
Detects weather the website is being opened in a mobile device or a desktop
|
||||||
|
|
||||||
```js
|
```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"
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user