From 99a1564b651006e32f8ef2571f829e18d9b6bc21 Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Sun, 24 Dec 2017 13:10:31 +0530 Subject: [PATCH] Fixed typo and added examples --- snippets/detectDeviceType.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/detectDeviceType.md b/snippets/detectDeviceType.md index fcf4ea741..26123a32a 100644 --- a/snippets/detectDeviceType.md +++ b/snippets/detectDeviceType.md @@ -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" ``` \ No newline at end of file