update snippets 16-31

This commit is contained in:
Stefan Feješ
2017-12-25 14:05:36 +01:00
parent 9b57350525
commit 823aa0c305
15 changed files with 66 additions and 27 deletions

View File

@ -6,6 +6,9 @@ Use a regular expression to test the `navigator.userAgent` property to figure ou
```js
const detectDeviceType = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop";
// detectDeviceType() -> "Mobile"
// detectDeviceType() -> "Desktop"
```
```js
detectDeviceType() -> "Mobile"
detectDeviceType() -> "Desktop"
```